‪TYPO3CMS  10.4
ElementsBasicInputEvalCest.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 {
35  public function ‪_before(‪BackendTester $I, ‪PageTree $pageTree)
36  {
37  $I->useExistingSession('admin');
38  $I->click('List');
39  $pageTree->openPath(['styleguide TCA demo', 'elements basic']);
40  $I->switchToContentFrame();
41 
42  // Open record and wait until form is ready
43  $I->waitForText('elements basic', 20);
44  $editRecordLinkCssPath = '#recordlist-tx_styleguide_elements_basic a[data-original-title="Edit record"]';
45  $I->click($editRecordLinkCssPath);
46  $I->waitForElementNotVisible('#t3js-ui-block');
47  $I->waitForText('Edit Form', 3, 'h1');
48  }
49 
54  {
55  return [
56  [
57  'label' => 'input_8 eval=double2',
58  'inputValue' => '12.335',
59  'expectedValue' => '12.34',
60  'expectedInternalValue' => '12.34',
61  'expectedValueAfterSave' => '12.34',
62  'comment' => '',
63  ],
64  [
65  'label' => 'input_8 eval=double2',
66  'inputValue' => '12,335', // comma as delimiter
67  'expectedValue' => '12.34',
68  'expectedInternalValue' => '12.34',
69  'expectedValueAfterSave' => '12.34',
70  'comment' => '',
71  ],
72  [
73  'label' => 'input_8 eval=double2',
74  'inputValue' => '1.1', // dot as delimiter
75  'expectedValue' => '1.10',
76  'expectedInternalValue' => '1.10',
77  'expectedValueAfterSave' => '1.10',
78  'comment' => '',
79  ],
80  [
81  'label' => 'input_8 eval=double2',
82  'inputValue' => 'TYPO3', // word having a number at end
83  'expectedValue' => '3.00',
84  'expectedInternalValue' => '3.00',
85  'expectedValueAfterSave' => '3.00',
86  'comment' => '',
87  ],
88  [
89  'label' => 'input_8 eval=double2',
90  'inputValue' => '3TYPO', // word having a number in front
91  'expectedValue' => '3.00',
92  'expectedInternalValue' => '3.00',
93  'expectedValueAfterSave' => '3.00',
94  'comment' => '',
95  ],
96  [
97  'label' => 'input_9 eval=int',
98  'inputValue' => '12.335',
99  'expectedValue' => '12',
100  'expectedInternalValue' => '12',
101  'expectedValueAfterSave' => '12',
102  'comment' => '',
103  ],
104  [
105  'label' => 'input_9 eval=int',
106  'inputValue' => '12,9',
107  'expectedValue' => '129',
108  'expectedInternalValue' => '129',
109  'expectedValueAfterSave' => '129',
110  'comment' => '',
111  ],
123  [
124  'label' => 'input_9 eval=int',
125  'inputValue' => '3TYPO',
126  'expectedValue' => '3',
127  'expectedInternalValue' => '3',
128  'expectedValueAfterSave' => '3',
129  'comment' => '',
130  ],
131  [
132  'label' => 'input_15 eval=num',
133  'inputValue' => '12.335',
134  'expectedValue' => '12335',
135  'expectedInternalValue' => '12335',
136  'expectedValueAfterSave' => '12335',
137  'comment' => '',
138  ],
139  [
140  'label' => 'input_15 eval=num',
141  'inputValue' => '12,9',
142  'expectedValue' => '129',
143  'expectedInternalValue' => '129',
144  'expectedValueAfterSave' => '129',
145  'comment' => '',
146  ],
147  [
148  'label' => 'input_15 eval=num',
149  'inputValue' => 'TYPO3',
150  'expectedValue' => '3',
151  'expectedInternalValue' => '3',
152  'expectedValueAfterSave' => '3',
153  'comment' => '',
154  ],
155  [
156  'label' => 'input_15 eval=num',
157  'inputValue' => '3TYPO',
158  'expectedValue' => '3',
159  'expectedInternalValue' => '3',
160  'expectedValueAfterSave' => '3',
161  'comment' => '',
162  ],
163  ];
164  }
165 
171  public function ‪simpleEvalInputFields(‪BackendTester $I, Example $testData)
172  {
173  $this->‪runInputFieldTest($I, $testData);
174  }
175 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\AbstractElementsBasicCest\runInputFieldTest
‪runInputFieldTest(BackendTester $I, Example $testData)
Definition: AbstractElementsBasicCest.php:39
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputEvalCest\simpleEvalInputFields
‪simpleEvalInputFields(BackendTester $I, Example $testData)
Definition: ElementsBasicInputEvalCest.php:171
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputEvalCest
Definition: ElementsBasicInputEvalCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputEvalCest\simpleEvalInputFieldsDataProvider
‪simpleEvalInputFieldsDataProvider()
Definition: ElementsBasicInputEvalCest.php:53
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputEvalCest\_before
‪_before(BackendTester $I, PageTree $pageTree)
Definition: ElementsBasicInputEvalCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\AbstractElementsBasicCest
Definition: AbstractElementsBasicCest.php:31
‪TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree
Definition: PageTree.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine
Definition: AbstractElementsBasicCest.php:18