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