‪TYPO3CMS  10.4
FrontendUsersVisibleFieldsTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
21 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
22 
23 class ‪FrontendUsersVisibleFieldsTest extends FunctionalTestCase
24 {
25  protected static ‪$frontendUsersFields = [
26  'disable',
27  'username',
28  'password',
29  'usergroup',
30  'company',
31  'title',
32  'name',
33  'first_name',
34  'middle_name',
35  'last_name',
36  'address',
37  'zip',
38  'city',
39  'country',
40  'telephone',
41  'fax',
42  'email',
43  'www',
44  'image',
45  'lockToDomain',
46  'TSconfig',
47  'starttime',
48  'endtime',
49  'tx_extbase_type',
50  ];
51 
56  {
57  $this->setUpBackendUserFromFixture(1);
58  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
59 
60  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
61  $formResult = $formEngineTestService->createNewRecordForm('fe_users');
62 
63  foreach (static::$frontendUsersFields as $expectedField) {
64  self::assertNotFalse(
65  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
66  'The field ' . $expectedField . ' is not in the form HTML'
67  );
68  }
69 
70  self::assertNotFalse(
71  strpos($formResult['html'], 'Last login'),
72  'The field Last login is not in the HTML'
73  );
74  }
75 }
‪TYPO3\CMS\Frontend\Tests\Functional\Tca
Definition: BackendLayoutVisibleFieldsTest.php:16
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest\$frontendUsersFields
‪static $frontendUsersFields
Definition: FrontendUsersVisibleFieldsTest.php:25
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest
Definition: FrontendUsersVisibleFieldsTest.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService
Definition: FormTestService.php:27
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest\frontendUsersFormContainsExpectedFields
‪frontendUsersFormContainsExpectedFields()
Definition: FrontendUsersVisibleFieldsTest.php:55