‪TYPO3CMS  10.4
WorkspaceVisibleFieldsTest.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 ‪WorkspaceVisibleFieldsTest extends FunctionalTestCase
24 {
28  protected ‪$coreExtensionsToLoad = ['workspaces'];
29 
33  protected static ‪$workspaceFields = [
34  'title',
35  'description',
36  'adminusers',
37  'members',
38  'stagechg_notification',
39  'edit_allow_notificaton_settings',
40  'edit_notification_preselection',
41  'edit_notification_defaults',
42  'publish_allow_notificaton_settings',
43  'publish_notification_preselection',
44  'publish_notification_defaults',
45  'execute_allow_notificaton_settings',
46  'execute_notification_preselection',
47  'execute_notification_defaults',
48  'db_mountpoints',
49  'file_mountpoints',
50  'publish_time',
51  'custom_stages',
52  'freeze',
53  'live_edit',
54  'swap_modes',
55  'publish_access',
56  ];
57 
61  protected function ‪setUp(): void
62  {
63  parent::setUp();
64 
65  $this->setUpBackendUserFromFixture(1);
66  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
67 
68  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/workspaces/Tests/Functional/Fixtures/sys_filemounts.xml');
69  }
70 
75  {
76  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
77  $formResult = $formEngineTestService->createNewRecordForm('sys_workspace');
78 
79  foreach (static::$workspaceFields as $expectedField) {
80  self::assertNotFalse(
81  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
82  'The field ' . $expectedField . ' is not in the form HTML'
83  );
84  }
85  }
86 }
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest
Definition: WorkspaceVisibleFieldsTest.php:24
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\setUp
‪setUp()
Definition: WorkspaceVisibleFieldsTest.php:59
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\workspaceFormContainsExpectedFields
‪workspaceFormContainsExpectedFields()
Definition: WorkspaceVisibleFieldsTest.php:72
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: WorkspaceVisibleFieldsTest.php:27
‪$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\Workspaces\Tests\Functional\Tca
Definition: WorkspaceStageVisibleFieldsTest.php:16
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\$workspaceFields
‪static array $workspaceFields
Definition: WorkspaceVisibleFieldsTest.php:31