[BUGFIX] Add missing namespace parts
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Tests / Unit / ViewHelpers / Form / DatePickerViewHelperTest.php
1 <?php
2 declare(strict_types=1);
3 namespace TYPO3\CMS\Form\Tests\Unit\ViewHelpers\Form;
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
18 use TYPO3\CMS\Form\ViewHelpers\Form\DatePickerViewHelper;
19
20 /**
21 * Test case
22 */
23 class DatePickerViewHelperTest extends \TYPO3\Components\TestingFramework\Core\Unit\UnitTestCase
24 {
25
26 /**
27 * @var \TYPO3\CMS\Form\ViewHelpers\Form\DatePickerViewHelper
28 */
29 protected $subject = null;
30
31 /**
32 * Set up
33 *
34 * @return void
35 */
36 protected function setUp()
37 {
38 $this->subject = $this->getAccessibleMock(DatePickerViewHelper::class, [
39 'dummy'
40 ], [], '', false);
41 }
42
43 /**
44 * @test
45 */
46 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat01()
47 {
48 $input = 'd';
49 $expected = 'dd';
50 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
51 }
52
53 /**
54 * @test
55 */
56 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat02()
57 {
58 $input = 'D';
59 $expected = 'D';
60 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
61 }
62
63 /**
64 * @test
65 */
66 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat03()
67 {
68 $input = 'j';
69 $expected = 'o';
70 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
71 }
72
73 /**
74 * @test
75 */
76 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat04()
77 {
78 $input = 'l';
79 $expected = 'DD';
80 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
81 }
82
83 /**
84 * @test
85 */
86 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat05()
87 {
88 $input = 'F';
89 $expected = 'MM';
90 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
91 }
92
93 /**
94 * @test
95 */
96 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat06()
97 {
98 $input = 'm';
99 $expected = 'mm';
100 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
101 }
102
103 /**
104 * @test
105 */
106 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat07()
107 {
108 $input = 'M';
109 $expected = 'M';
110 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
111 }
112
113 /**
114 * @test
115 */
116 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat08()
117 {
118 $input = 'n';
119 $expected = 'm';
120 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
121 }
122
123 /**
124 * @test
125 */
126 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat09()
127 {
128 $input = 'Y';
129 $expected = 'yy';
130 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
131 }
132
133 /**
134 * @test
135 */
136 public function convertDateFormatToDatePickerFormatReturnsTransformedFormat10()
137 {
138 $input = 'y';
139 $expected = 'y';
140 $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
141 }
142 }