‪TYPO3CMS  9.5
DatePickerViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪DatePickerViewHelperTest extends UnitTestCase
25 {
26 
30  protected ‪$subject;
31 
35  protected function ‪setUp()
36  {
37  $this->subject = $this->getAccessibleMock(DatePickerViewHelper::class, [
38  'dummy'
39  ], [], '', false);
40  }
41 
46  {
47  $input = 'd';
48  $expected = 'dd';
49  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
50  }
51 
56  {
57  $input = 'D';
58  $expected = 'D';
59  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
60  }
61 
66  {
67  $input = 'j';
68  $expected = 'o';
69  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
70  }
71 
76  {
77  $input = 'l';
78  $expected = 'DD';
79  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
80  }
81 
86  {
87  $input = 'F';
88  $expected = 'MM';
89  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
90  }
91 
96  {
97  $input = 'm';
98  $expected = 'mm';
99  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
100  }
101 
106  {
107  $input = 'M';
108  $expected = 'M';
109  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
110  }
111 
116  {
117  $input = 'n';
118  $expected = 'm';
119  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
120  }
121 
126  {
127  $input = 'Y';
128  $expected = 'yy';
129  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
130  }
131 
136  {
137  $input = 'y';
138  $expected = 'y';
139  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
140  }
141 }
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\$subject
‪TYPO3 CMS Form ViewHelpers Form DatePickerViewHelper $subject
Definition: DatePickerViewHelperTest.php:29
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat02
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat02()
Definition: DatePickerViewHelperTest.php:54
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat08
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat08()
Definition: DatePickerViewHelperTest.php:114
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat10
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat10()
Definition: DatePickerViewHelperTest.php:134
‪TYPO3\CMS\Form\ViewHelpers\Form\DatePickerViewHelper
Definition: DatePickerViewHelper.php:33
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat04
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat04()
Definition: DatePickerViewHelperTest.php:74
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat03
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat03()
Definition: DatePickerViewHelperTest.php:64
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\setUp
‪setUp()
Definition: DatePickerViewHelperTest.php:34
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest
Definition: DatePickerViewHelperTest.php:25
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat05
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat05()
Definition: DatePickerViewHelperTest.php:84
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat06
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat06()
Definition: DatePickerViewHelperTest.php:94
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat07
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat07()
Definition: DatePickerViewHelperTest.php:104
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form
Definition: DatePickerViewHelperTest.php:3
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat01
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat01()
Definition: DatePickerViewHelperTest.php:44
‪TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form\DatePickerViewHelperTest\convertDateFormatToDatePickerFormatReturnsTransformedFormat09
‪convertDateFormatToDatePickerFormatReturnsTransformedFormat09()
Definition: DatePickerViewHelperTest.php:124