Project

General

Profile

Actions

Bug #55271

closed

Test 'filterForStringReturnsStringWithUppercasedWords' breaks ß

Added by Stefano Kowalke over 10 years ago. Updated over 8 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 #1

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27021

Actions #2

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27021

Actions #3

Updated by Anja Leichsenring about 9 years ago

  • Sprint Focus set to On Location Sprint
Actions #4

Updated by Steffen Müller about 9 years ago

  • Status changed from Under Review to Closed

Already fixed via #62279

Actions #5

Updated by Anja Leichsenring over 8 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF