‪TYPO3CMS  9.5
FileCollectionVisibleFieldsTest.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 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
21 
22 class ‪FileCollectionVisibleFieldsTest extends FunctionalTestCase
23 {
24  protected static ‪$fileCollectionFields = [
25  'title',
26  'sys_language_uid',
27  'type',
28  'starttime',
29  'endtime',
30  ];
31 
32  protected static ‪$fileCollectionTypeFields = [
33  '0' => ['files'],
34  'category' => ['category'],
35  'folder' => [
36  'storage',
37  'folder',
38  'recursive',
39  ],
40  'static' => ['files'],
41  ];
42 
47  {
48  $this->setUpBackendUserFromFixture(1);
49  ‪$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
50 
51  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
52 
53  foreach (static::$fileCollectionTypeFields as $type => $additionalFields) {
54  $formResult = $formEngineTestService->createNewRecordForm('sys_file_collection', ['type' => $type]);
55  $expectedFields = array_merge(static::$fileCollectionFields, $additionalFields);
56  foreach ($expectedFields as $expectedField) {
57  $this->assertNotFalse(
58  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
59  'The field ' . $expectedField . ' is not in the form HTML'
60  );
61  }
62  }
63  }
64 }
‪TYPO3\CMS\Core\Tests\Functional\Tca\FileCollectionVisibleFieldsTest\$fileCollectionFields
‪static $fileCollectionFields
Definition: FileCollectionVisibleFieldsTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\Tca\FileCollectionVisibleFieldsTest
Definition: FileCollectionVisibleFieldsTest.php:23
‪TYPO3\CMS\Core\Tests\Functional\Tca
Definition: BackendGroupsVisibleFieldsTest.php:2
‪TYPO3\CMS\Core\Tests\Functional\Tca\FileCollectionVisibleFieldsTest\fileCollectionFormContainsExpectedFields
‪fileCollectionFormContainsExpectedFields()
Definition: FileCollectionVisibleFieldsTest.php:46
‪$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\Core\Tests\Functional\Tca\FileCollectionVisibleFieldsTest\$fileCollectionTypeFields
‪static $fileCollectionTypeFields
Definition: FileCollectionVisibleFieldsTest.php:32