‪TYPO3CMS  11.5
ContentVisibleFieldsTest.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 ‪ContentVisibleFieldsTest extends FunctionalTestCase
26 {
27  protected ‪$coreExtensionsToLoad = ['felogin'];
28 
32  protected static ‪$contentFields = [
33  'CType',
34  'colPos',
35  'sys_language_uid',
36  'header',
37  'header_layout',
38  'date',
39  'header_link',
40  'starttime',
41  'endtime',
42  'fe_group',
43  'editlock',
44  'rowDescription',
45  'categories',
46  'pi_flexform',
47  ];
48 
52  public function ‪loginFormContainsExpectedFields(): void
53  {
54  $this->setUpBackendUserFromFixture(1);
55  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
56 
57  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
58  $formResult = $formEngineTestService->createNewRecordForm('tt_content', ['CType' => 'felogin_login']);
59 
60  foreach (static::$contentFields as $expectedField) {
61  self::assertNotFalse(
62  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
63  'The field ' . $expectedField . ' is not in the form HTML'
64  );
65  }
66  }
67 }
‪TYPO3\CMS\Core\Localization\LanguageServiceFactory
Definition: LanguageServiceFactory.php:25
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Tca\ContentVisibleFieldsTest\loginFormContainsExpectedFields
‪loginFormContainsExpectedFields()
Definition: ContentVisibleFieldsTest.php:51
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Tca\ContentVisibleFieldsTest\$contentFields
‪static array $contentFields
Definition: ContentVisibleFieldsTest.php:31
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Tca\ContentVisibleFieldsTest\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: ContentVisibleFieldsTest.php:27
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService
Definition: FormTestService.php:29
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Tca\ContentVisibleFieldsTest
Definition: ContentVisibleFieldsTest.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\FrontendLogin\Tests\Functional\Tca
Definition: ContentVisibleFieldsTest.php:18