‪TYPO3CMS  11.5
FrontendUsersVisibleFieldsTest.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 
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
25 class ‪FrontendUsersVisibleFieldsTest extends FunctionalTestCase
26 {
27  protected static array ‪$frontendUsersFields = [
28  'disable',
29  'username',
30  'password',
31  'usergroup',
32  'company',
33  'title',
34  'name',
35  'first_name',
36  'middle_name',
37  'last_name',
38  'address',
39  'zip',
40  'city',
41  'country',
42  'telephone',
43  'fax',
44  'email',
45  'www',
46  'image',
47  'TSconfig',
48  'starttime',
49  'endtime',
50  'tx_extbase_type',
51  ];
52 
57  {
58  $this->setUpBackendUserFromFixture(1);
59  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
60 
61  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
62  $formResult = $formEngineTestService->createNewRecordForm('fe_users');
63 
64  foreach (static::$frontendUsersFields as $expectedField) {
65  self::assertNotFalse(
66  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
67  'The field ' . $expectedField . ' is not in the form HTML'
68  );
69  }
70 
71  self::assertNotFalse(
72  strpos($formResult['html'], 'Last login'),
73  'The field Last login is not in the HTML'
74  );
75  }
76 }
‪TYPO3\CMS\Core\Localization\LanguageServiceFactory
Definition: LanguageServiceFactory.php:25
‪TYPO3\CMS\Frontend\Tests\Functional\Tca
Definition: BackendLayoutVisibleFieldsTest.php:18
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest
Definition: FrontendUsersVisibleFieldsTest.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest\$frontendUsersFields
‪static array $frontendUsersFields
Definition: FrontendUsersVisibleFieldsTest.php:27
‪TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService
Definition: FormTestService.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Frontend\Tests\Functional\Tca\FrontendUsersVisibleFieldsTest\frontendUsersFormContainsExpectedFields
‪frontendUsersFormContainsExpectedFields()
Definition: FrontendUsersVisibleFieldsTest.php:56