4d4c6cd224c50f2bdc239433bad9237ce30d7efe
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / Tca / BackendGroupsVisibleFieldsTest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Unit\Tca;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService;
18 use TYPO3\CMS\Core\Utility\GeneralUtility;
19 use TYPO3\CMS\Lang\LanguageService;
20
21 class BackendGroupsVisibleFieldsTest extends \TYPO3\Components\TestingFramework\Core\FunctionalTestCase
22 {
23 protected static $backendGroupsFields = [
24 'hidden',
25 'title',
26 'description',
27 'subgroup',
28 'groupMods',
29 'tables_select',
30 'tables_modify',
31 'pagetypes_select',
32 'non_exclude_fields',
33 'explicit_allowdeny',
34 'allowed_languages',
35 'workspace_perms',
36 'db_mountpoints',
37 'file_mountpoints',
38 'file_permissions',
39 'category_perms',
40 'lockToDomain',
41 'hide_in_lists',
42 'TSconfig',
43 ];
44
45 /**
46 * @test
47 */
48 public function backendGroupsFormContainsExpectedFields()
49 {
50 $this->setUpBackendUserFromFixture(1);
51 $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
52
53 $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
54 $formResult = $formEngineTestService->createNewRecordForm('be_groups');
55
56 foreach (static::$backendGroupsFields as $expectedField) {
57 $this->assertNotFalse(
58 $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
59 'The field ' . $expectedField . ' is not in the HTML'
60 );
61 }
62 }
63 }