‪TYPO3CMS  10.4
ElementsBasicInputSimpleCest.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 
53  protected function ‪simpleInputFieldsDataProvider()
54  {
55  return [
56  [
57  'label' => 'input_1',
58  'inputValue' => 'This is a demo text',
59  'expectedValue' => 'This is a demo text',
60  'expectedInternalValue' => 'This is a demo text',
61  'expectedValueAfterSave' => 'This is a demo text',
62  'comment' => '',
63  ],
64  [
65  'label' => 'input_2, size=10',
66  'inputValue' => 'This is a demo text with numbers and other characters 42 #!',
67  'expectedValue' => 'This is a demo text with numbers and other characters 42 #!',
68  'expectedInternalValue' => 'This is a demo text with numbers and other characters 42 #!',
69  'expectedValueAfterSave' => 'This is a demo text with numbers and other characters 42 #!',
70  'comment' => '',
71  ],
72  [
73  'label' => 'input_3 max=4',
74  'inputValue' => 'Kasper',
75  'expectedValue' => 'Kasp',
76  'expectedInternalValue' => 'Kasp',
77  'expectedValueAfterSave' => 'Kasp',
78  'comment' => '',
79  ],
80  [
81  'label' => 'input_4 eval=alpha',
82  'inputValue' => 'Kasper = TYPO3',
83  'expectedValue' => 'KasperTYPO',
84  'expectedInternalValue' => 'KasperTYPO',
85  'expectedValueAfterSave' => 'KasperTYPO',
86  'comment' => '',
87  ],
88  [
89  'label' => 'input_4 eval=alpha',
90  'inputValue' => 'Non-latin characters: ŠĐŽĆČ',
91  'expectedValue' => 'Nonlatincharacters',
92  'expectedInternalValue' => 'Nonlatincharacters',
93  'expectedValueAfterSave' => 'Nonlatincharacters',
94  'comment' => '',
95  ],
96  [
97  'label' => 'input_5 eval=alphanum',
98  'inputValue' => 'Kasper = TYPO3',
99  'expectedValue' => 'KasperTYPO3',
100  'expectedInternalValue' => 'KasperTYPO3',
101  'expectedValueAfterSave' => 'KasperTYPO3',
102  'comment' => '',
103  ],
104  [
105  'label' => 'input_10 eval=is_in is_in=abc123',
106  'inputValue' => 'abcd1234',
107  'expectedValue' => 'abc123',
108  'expectedInternalValue' => 'abc123',
109  'expectedValueAfterSave' => 'abc123',
110  'comment' => '',
111  ],
112  [
113  'label' => 'input_10 eval=is_in is_in=abc123',
114  'inputValue' => 'Kasper TYPO3',
115  'expectedValue' => 'a3',
116  'expectedInternalValue' => 'a3',
117  'expectedValueAfterSave' => 'a3',
118  'comment' => '',
119  ],
120  [
121  'label' => 'input_11 eval=lower',
122  'inputValue' => 'Kasper TYPO3!',
123  'expectedValue' => 'kasper typo3!',
124  'expectedInternalValue' => 'kasper typo3!',
125  'expectedValueAfterSave' => 'kasper typo3!',
126  'comment' => '',
127  ],
128  [
129  'label' => 'input_13 eval=nospace',
130  'inputValue' => ' Kasper TYPO3! ',
131  'expectedValue' => 'KasperTYPO3!',
132  'expectedInternalValue' => 'KasperTYPO3!',
133  'expectedValueAfterSave' => 'KasperTYPO3!',
134  'comment' => '',
135  ],
136  [
137  'label' => 'input_16 eval=password',
138  'inputValue' => 'Kasper',
139  'expectedValue' => '********',
140  'expectedInternalValue' => 'Kasper',
141  'expectedValueAfterSave' => 'Kasper',
142  'comment' => '',
143  ],
144  [
145  'label' => 'input_19 eval=trim',
146  'inputValue' => ' Kasper ',
147  'expectedValue' => 'Kasper',
148  'expectedInternalValue' => 'Kasper',
149  'expectedValueAfterSave' => 'Kasper',
150  'comment' => '',
151  ],
152  [
153  'label' => 'input_19 eval=trim',
154  'inputValue' => ' Kasper TYPO3 ',
155  'expectedValue' => 'Kasper TYPO3',
156  'expectedInternalValue' => 'Kasper TYPO3',
157  'expectedValueAfterSave' => 'Kasper TYPO3',
158  'comment' => '',
159  ],
160  [
161  'label' => 'input_23 eval=upper',
162  'inputValue' => 'Kasper TYPO3!',
163  'expectedValue' => 'KASPER TYPO3!',
164  'expectedInternalValue' => 'KASPER TYPO3!',
165  'expectedValueAfterSave' => 'KASPER TYPO3!',
166  'comment' => '',
167  ],
168  [
169  'label' => 'input_24 eval=year',
170  'inputValue' => '2016',
171  'expectedValue' => '2016',
172  'expectedInternalValue' => '2016',
173  'expectedValueAfterSave' => '2016',
174  'comment' => '',
175  ],
176  [
177  'label' => 'input_24 eval=year',
178  'inputValue' => '12',
179  'expectedValue' => '12',
180  'expectedInternalValue' => '12',
181  'expectedValueAfterSave' => '12',
182  'comment' => '',
183  ],
184  [
185  'label' => 'input_24 eval=year',
186  'inputValue' => 'Kasper',
187  'expectedValue' => date('Y'),
188  'expectedInternalValue' => date('Y'),
189  'expectedValueAfterSave' => date('Y'),
190  'comment' => 'Invalid character is converted to current year',
191  ]
192  ];
193  }
194 
200  public function ‪simpleInputFields(‪BackendTester $I, Example $testData)
201  {
202  $this->‪runInputFieldTest($I, $testData);
203  }
204 }
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputSimpleCest\simpleInputFieldsDataProvider
‪simpleInputFieldsDataProvider()
Definition: ElementsBasicInputSimpleCest.php:53
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputSimpleCest\simpleInputFields
‪simpleInputFields(BackendTester $I, Example $testData)
Definition: ElementsBasicInputSimpleCest.php:200
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputSimpleCest\_before
‪_before(BackendTester $I, PageTree $pageTree)
Definition: ElementsBasicInputSimpleCest.php:35
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\ElementsBasicInputSimpleCest
Definition: ElementsBasicInputSimpleCest.php:28
‪TYPO3\CMS\Core\Tests\Acceptance\Backend\FormEngine\AbstractElementsBasicCest\runInputFieldTest
‪runInputFieldTest(BackendTester $I, Example $testData)
Definition: AbstractElementsBasicCest.php:39
‪TYPO3\CMS\Core\Tests\Acceptance\Support\BackendTester
Definition: BackendTester.php:27
‪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