Project

General

Profile

Actions

Bug #55271

closed

Test 'filterForStringReturnsStringWithUppercasedWords' breaks ß

Added by Stefano Kowalke almost 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Tests
Target version:
Start date:
2014-01-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The test fails with message:

TYPO3\CMS\Form\Tests\Unit\Filter\TitleCaseFilterTest::filterForStringReturnsStringWithUppercasedWords with data set "Ein Maß" ('Ein Maß', 'Ein Maß')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-Ein Maß
+Ein Ma<E3><9F>

typo3/sysext/form/Tests/Unit/Filter/TitleCaseFilterTest.php:72


My setup:
OSX 10.8.5

$ locale
LANG="de_DE.UTF-8" 
LC_COLLATE="de_DE.UTF-8" 
LC_CTYPE="de_DE.UTF-8" 
LC_MESSAGES="de_DE.UTF-8" 
LC_MONETARY="de_DE.UTF-8" 
LC_NUMERIC="de_DE.UTF-8" 
LC_TIME="de_DE.UTF-8" 
LC_ALL=

I got it running with the following changing in the code:

class TitleCaseFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        ...

       /**
     * Set up
     */
    public function setUp() {
        mb_internal_encoding('UTF-8'); // adding this
        $this->fixture = new \TYPO3\CMS\Form\Filter\TitleCaseFilter();
    }

class TitleCaseFilter implements \TYPO3\CMS\Form\Filter\FilterInterface {

    /**
     * Convert alphabetic characters to title case
     *
     * @param string $value
     * @return string
     */
    public function filter($value) {
        return ucwords(mb_strtolower((string) $value)); // using mb_strtolower instead of strtolower
    }

}

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #62279: TitleCaseFilter doesn't properly handle utf-8 stringsClosedGraeme Worthy2014-10-162014-10-16

Actions
Actions

Also available in: Atom PDF