‪TYPO3CMS  9.5
ActionVisibleFieldsTest.php
Go to the documentation of this file.
1 <?php
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 
20 
21 class ‪ActionVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
22 {
23  protected ‪$coreExtensionsToLoad = ['sys_action'];
24 
25  protected static ‪$actionCommonFields = [
26  'type',
27  'title',
28  'description',
29  'hidden',
30  'assign_to_groups',
31  ];
32 
33  protected static ‪$actionFieldsByType = [
34  '0' => [],
35  '1' => [
36  't1_userprefix',
37  't1_copy_of_user',
38  't1_allowed_groups',
39  't1_create_user_dir',
40  ],
41  '2' => [],
42  '3' => [
43  't3_listPid',
44  't3_tables',
45  ],
46  '4' => [
47  't4_recordsToEdit',
48  ],
49  '5' => [
50  't3_listPid',
51  't3_tables',
52  ],
53  ];
54 
59  {
60  $this->setUpBackendUserFromFixture(1);
61  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
62 
63  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
64 
65  foreach (static::$actionFieldsByType as $type => $additionalFields) {
66  $expectedFields = array_merge(static::$actionCommonFields, $additionalFields);
67  $formResult = $formEngineTestService->createNewRecordForm('sys_action', ['type' => $type]);
68 
69  foreach ($expectedFields as $expectedField) {
70  $this->assertNotFalse(
71  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
72  'The field ' . $expectedField . ' is not in the form HTML'
73  );
74  }
75  }
76  }
77 }
‪TYPO3\CMS\SysAction\Tests\Functional\Tca\ActionVisibleFieldsTest
Definition: ActionVisibleFieldsTest.php:22
‪TYPO3\CMS\SysAction\Tests\Functional\Tca\ActionVisibleFieldsTest\actionFormContainsExpectedFields
‪actionFormContainsExpectedFields()
Definition: ActionVisibleFieldsTest.php:58
‪TYPO3\CMS\SysAction\Tests\Functional\Tca\ActionVisibleFieldsTest\$actionFieldsByType
‪static $actionFieldsByType
Definition: ActionVisibleFieldsTest.php:33
‪TYPO3\CMS\SysAction\Tests\Functional\Tca
Definition: ActionVisibleFieldsTest.php:2
‪TYPO3\CMS\SysAction\Tests\Functional\Tca\ActionVisibleFieldsTest\$actionCommonFields
‪static $actionCommonFields
Definition: ActionVisibleFieldsTest.php:25
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService
Definition: FormTestService.php:26
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\SysAction\Tests\Functional\Tca\ActionVisibleFieldsTest\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: ActionVisibleFieldsTest.php:23