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