‪TYPO3CMS  11.5
ElementsBasicInputDateCest.php
Go to the documentation of this file.
1 <?php
2 
3 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 
20 use Codeception\Example;
23 
28 {
36  public function ‪_before(‪ApplicationTester $I, ‪PageTree $pageTree): void
37  {
38  $I->useExistingSession('admin');
39 
40  $I->click('List');
41  $I->waitForElement('svg .nodes .node');
42  $pageTree->‪openPath(['styleguide TCA demo', 'elements basic']);
43  $I->switchToContentFrame();
44 
45  // Open record and wait until form is ready
46  $I->waitForText('elements basic', 20);
47  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[aria-label="Edit record"]';
48  $I->click($editRecordLinkCssPath);
49  $I->waitForElementNotVisible('#t3js-ui-block');
50 
51  $I->waitForText('Edit Form', 3, 'h1');
52 
53  // Make sure the test operates on the "inputDateTime" tab
54  $I->click('inputDateTime');
55  }
56 
60  protected function ‪dbTypeDateEvalDateDataProvider(): array
61  {
62  return [
63  [
64  'label' => 'inputdatetime_2',
65  'inputValue' => '29-01-2016',
66  'expectedValue' => '29-01-2016',
67  'expectedInternalValue' => '2016-01-29T00:00:00Z',
68  'expectedValueAfterSave' => '2016-01-29T00:00:00+00:00',
69  'comment' => 'inputdatetime_2 dbType=date eval=date simple input',
70  ],
71  [
72  'label' => 'inputdatetime_2',
73  'inputValue' => '13-13-2016',
74  'expectedValue' => '13-01-2017',
75  'expectedInternalValue' => '2017-01-13T00:00:00Z',
76  'expectedValueAfterSave' => '2017-01-13T00:00:00+00:00',
77  'comment' => 'inputdatetime_2 dbType=date eval=date month transformation',
78  ],
79  [
80  'label' => 'inputdatetime_2',
81  'inputValue' => '29-02-2016',
82  'expectedValue' => '29-02-2016',
83  'expectedInternalValue' => '2016-02-29T00:00:00Z',
84  'expectedValueAfterSave' => '2016-02-29T00:00:00+00:00',
85  'comment' => 'inputdatetime_2 dbType=date eval=date Check valid leap year input',
86  ],
87  ];
88  }
89 
96  public function ‪dbTypeDateEvalDate(‪ApplicationTester $I, Example $testData): void
97  {
98  $this->‪runInputFieldTest($I, $testData);
99  }
100 
104  protected function ‪dbTypeDateEvalDatetimeDataProvider(): array
105  {
106  return [
107  [
108  'label' => 'inputdatetime_3',
109  'inputValue' => '05:23 29-01-2016',
110  'expectedValue' => '05:23 29-01-2016',
111  'expectedInternalValue' => '2016-01-29T05:23:00Z',
112  'expectedValueAfterSave' => '2016-01-29T05:23:00+00:00',
113  'comment' => 'inputdatetime_3 eval=datetime simple input',
114  ],
115  [
116  'label' => 'inputdatetime_3',
117  'inputValue' => '05:23 29-02-2016',
118  'expectedValue' => '05:23 29-02-2016',
119  'expectedInternalValue' => '2016-02-29T05:23:00Z',
120  'expectedValueAfterSave' => '2016-02-29T05:23:00+00:00',
121  'comment' => 'inputdatetime_3 eval=datetime Check valid leap year input',
122  ],
123  [
124  'label' => 'inputdatetime_11',
125  'inputValue' => '',
126  'expectedValue' => '',
127  'expectedInternalValue' => '0',
128  'expectedValueAfterSave' => '0',
129  'comment' => 'inputdatetime_11 eval=datetime range.lower=1627208536 Check range validation is ignored',
130  ],
131  ];
132  }
133 
140  public function ‪dbTypeDateEvalDatetime(‪ApplicationTester $I, Example $testData): void
141  {
142  $this->‪runInputFieldTest($I, $testData);
143  }
144 
148  protected function ‪dbTypeDateEvalTimeDataProvider(): array
149  {
150  return [
151  [
152  'label' => 'inputdatetime_5',
153  'inputValue' => '13:30',
154  'expectedValue' => '13:30',
155  'expectedInternalValue' => '1970-01-01T13:30:00Z',
156  'expectedValueAfterSave' => '1970-01-01T13:30:00+00:00',
157  'comment' => 'inputdatetime_5 eval=time time input',
158  ],
159  ];
160  }
161 
168  public function ‪dbTypeDateEvalTime(‪ApplicationTester $I, Example $testData): void
169  {
170  $this->‪runInputFieldTest($I, $testData);
171  }
172 
177  {
178  return [
179  [
180  'label' => 'inputdatetime_4',
181  'inputValue' => '05:23 29-01-2016',
182  'expectedValue' => '05:23 29-01-2016',
183  'expectedInternalValue' => '2016-01-29T05:23:00Z',
184  'expectedValueAfterSave' => '2016-01-29T05:23:00+00:00',
185  'comment' => 'inputdatetime_4 dbType=datetime eval=datetime no transformation',
186  ],
187  [
188  'label' => 'inputdatetime_4',
189  'inputValue' => '05:23 29-02-2016',
190  'expectedValue' => '05:23 29-02-2016',
191  'expectedInternalValue' => '2016-02-29T05:23:00Z',
192  'expectedValueAfterSave' => '2016-02-29T05:23:00+00:00',
193  'comment' => 'inputdatetime_4 dbType=datetime eval=datetime Check valid leap year input',
194  ],
195  [
196  'label' => 'inputdatetime_6',
197  'inputValue' => '13:30:00',
198  'expectedValue' => '13:30:00',
199  'expectedInternalValue' => '1970-01-01T13:30:00Z',
200  'expectedValueAfterSave' => '1970-01-01T13:30:00+00:00',
201  'comment' => 'inputdatetime_6 eval=timesec as time',
202  ],
203  ];
204  }
205 
213  {
214  $this->‪runInputFieldTest($I, $testData);
215  }
216 }
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalDateDataProvider
‪dbTypeDateEvalDateDataProvider()
Definition: ElementsBasicInputDateCest.php:60
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine
Definition: AbstractElementsBasicCest.php:18
‪TYPO3\CMS\Core\Tests\Acceptance\Support\ApplicationTester
Definition: ApplicationTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalTimeDataProvider_DbTypeDateTime
‪dbTypeDateEvalTimeDataProvider_DbTypeDateTime()
Definition: ElementsBasicInputDateCest.php:176
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalTime
‪dbTypeDateEvalTime(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputDateCest.php:168
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree\openPath
‪openPath(array $path)
Definition: PageTree.php:76
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalDatetime
‪dbTypeDateEvalDatetime(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputDateCest.php:140
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalDate
‪dbTypeDateEvalDate(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputDateCest.php:96
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\checkThatValidationWorks_EvalDateTime_DbTypeDateTime
‪checkThatValidationWorks_EvalDateTime_DbTypeDateTime(ApplicationTester $I, Example $testData)
Definition: ElementsBasicInputDateCest.php:212
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalDatetimeDataProvider
‪dbTypeDateEvalDatetimeDataProvider()
Definition: ElementsBasicInputDateCest.php:104
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest
Definition: ElementsBasicInputDateCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest\runInputFieldTest
‪runInputFieldTest(ApplicationTester $I, Example $testData)
Definition: AbstractElementsBasicCest.php:38
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\dbTypeDateEvalTimeDataProvider
‪dbTypeDateEvalTimeDataProvider()
Definition: ElementsBasicInputDateCest.php:148
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\ElementsBasicInputDateCest\_before
‪_before(ApplicationTester $I, PageTree $pageTree)
Definition: ElementsBasicInputDateCest.php:36
‪TYPO3\CMS\Core\Tests\Acceptance\Application\FormEngine\AbstractElementsBasicCest
Definition: AbstractElementsBasicCest.php:30
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:31