‪TYPO3CMS  10.4
ContentVisibleFieldsTest.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 ‪ContentVisibleFieldsTest extends FunctionalTestCase
24 {
28  protected ‪$coreExtensionsToLoad = ['fluid_styled_content'];
29 
33  protected static ‪$contentFields = [
34  'CType',
35  'colPos',
36  'sys_language_uid',
37  'header',
38  'header_layout',
39  'date',
40  'header_link',
41  'bodytext',
42  'assets',
43  'image_zoom',
44  'layout',
45  'imagewidth',
46  'imageheight',
47  'imageborder',
48  'imageorient',
49  'imagecols',
50  'sectionIndex',
51  'linkToTop',
52  'hidden',
53  'starttime',
54  'endtime',
55  'fe_group',
56  'editlock',
57  'rowDescription',
58  'categories',
59  ];
60 
64  public function ‪contentFormContainsExpectedFields()
65  {
66  $this->setUpBackendUserFromFixture(1);
67  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
68 
69  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
70 
71  $formResult = $formEngineTestService->createNewRecordForm('tt_content', ['CType' => 'textmedia']);
72 
73  foreach (static::$contentFields as $expectedField) {
74  self::assertNotFalse(
75  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
76  'The field ' . $expectedField . ' is not in the form HTML'
77  );
78  }
79  }
80 }
‪TYPO3\CMS\FluidStyledContent\Tests\Functional\Tca\ContentVisibleFieldsTest\contentFormContainsExpectedFields
‪contentFormContainsExpectedFields()
Definition: ContentVisibleFieldsTest.php:62
‪TYPO3\CMS\FluidStyledContent\Tests\Functional\Tca
Definition: ContentVisibleFieldsTest.php:16
‪TYPO3\CMS\FluidStyledContent\Tests\Functional\Tca\ContentVisibleFieldsTest
Definition: ContentVisibleFieldsTest.php:24
‪TYPO3\CMS\FluidStyledContent\Tests\Functional\Tca\ContentVisibleFieldsTest\$contentFields
‪static array $contentFields
Definition: ContentVisibleFieldsTest.php:31
‪$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\FluidStyledContent\Tests\Functional\Tca\ContentVisibleFieldsTest\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: ContentVisibleFieldsTest.php:27