TYPO3 CMS  TYPO3_8-7
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 
23 class DatePickerViewHelperTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
24 {
25 
29  protected $subject = null;
30 
34  protected function setUp()
35  {
36  $this->subject = $this->getAccessibleMock(DatePickerViewHelper::class, [
37  'dummy'
38  ], [], '', false);
39  }
40 
45  {
46  $input = 'd';
47  $expected = 'dd';
48  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
49  }
50 
55  {
56  $input = 'D';
57  $expected = 'D';
58  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
59  }
60 
65  {
66  $input = 'j';
67  $expected = 'o';
68  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
69  }
70 
75  {
76  $input = 'l';
77  $expected = 'DD';
78  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
79  }
80 
85  {
86  $input = 'F';
87  $expected = 'MM';
88  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
89  }
90 
95  {
96  $input = 'm';
97  $expected = 'mm';
98  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
99  }
100 
105  {
106  $input = 'M';
107  $expected = 'M';
108  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
109  }
110 
115  {
116  $input = 'n';
117  $expected = 'm';
118  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
119  }
120 
125  {
126  $input = 'Y';
127  $expected = 'yy';
128  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
129  }
130 
135  {
136  $input = 'y';
137  $expected = 'y';
138  $this->assertSame($expected, $this->subject->_call('convertDateFormatToDatePickerFormat', $input));
139  }
140 }