‪TYPO3CMS  ‪main
WorkspaceVisibleFieldsTest.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 
20 use PHPUnit\Framework\Attributes\Test;
24 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
25 
26 final class ‪WorkspaceVisibleFieldsTest extends FunctionalTestCase
27 {
28  protected array ‪$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  'publish_access',
55  ];
56 
60  protected function ‪setUp(): void
61  {
62  parent::setUp();
63 
64  $this->importCSVDataSet(__DIR__ . '/../Fixtures/be_users.csv');
65  $this->setUpBackendUser(1);
66  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create('default');
67 
68  $this->importCSVDataSet(__DIR__ . '/../Fixtures/sys_filemounts.csv');
69  }
70 
71  #[Test]
72  public function ‪workspaceFormContainsExpectedFields(): void
73  {
74  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
75  $formResult = $formEngineTestService->createNewRecordForm('sys_workspace');
76 
77  foreach (static::$workspaceFields as $expectedField) {
78  self::assertNotFalse(
79  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
80  'The field ' . $expectedField . ' is not in the form HTML'
81  );
82  }
83  }
84 }
‪TYPO3\CMS\Core\Localization\LanguageServiceFactory
Definition: LanguageServiceFactory.php:25
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest
Definition: WorkspaceVisibleFieldsTest.php:27
‪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:71
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: WorkspaceVisibleFieldsTest.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Tests\Functional\Form\FormTestService
Definition: FormTestService.php:32
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca
Definition: WorkspaceStageVisibleFieldsTest.php:18
‪TYPO3\CMS\Workspaces\Tests\Functional\Tca\WorkspaceVisibleFieldsTest\$workspaceFields
‪static array $workspaceFields
Definition: WorkspaceVisibleFieldsTest.php:32