[CLEANUP] Add missing empty lines after copyright comments II
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Tests / Unit / Filter / TitleCaseFilterTest.php
1 <?php
2 namespace TYPO3\CMS\Form\Tests\Unit\Filter;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Charset\CharsetConverter;
18 use TYPO3\CMS\Form\Filter\TitleCaseFilter;
19
20 /**
21 * Test case
22 *
23 * @author Andreas Lappe <nd@kaeufli.ch>
24 */
25 class TitleCaseFilterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
26
27 /**
28 * @var TitleCaseFilter
29 */
30 protected $fixture = NULL;
31
32 /**
33 * Set up
34 */
35 public function setUp() {
36 $this->fixture = new TitleCaseFilter();
37 $GLOBALS['TSFE'] = new \stdClass();
38 $GLOBALS['TSFE']->csConvObj = new CharsetConverter();
39 $GLOBALS['TSFE']->renderCharset = 'utf-8';
40 }
41
42 /**
43 * @return array
44 */
45 public function stringProvider() {
46 return array(
47 'some text' => array('some text', 'Some Text'),
48 'some Text' => array('some Text', 'Some Text'),
49 'Ein Maß' => array('Ein Maß', 'Ein Maß'),
50 '¿por que?' => array('¿por que?', '¿por Que?'),
51 );
52 }
53
54 /**
55 * @test
56 * @dataProvider stringProvider
57 */
58 public function filterForStringReturnsStringWithUppercasedWords($input, $expected) {
59 $this->assertSame(
60 $expected,
61 $this->fixture->filter($input)
62 );
63 }
64 }