TYPO3 CMS  TYPO3_8-7
FileMetadataVisibleFieldsTest.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 
21 
22 class FileMetadataVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
23 {
27  protected $coreExtensionsToLoad = ['filemetadata'];
28 
32  protected static $fileMetadataFields = [
34  'title',
35  'description',
36  'ranking',
37  'keywords',
38  'caption',
39  'download_name',
40  'visible',
41  'status',
42  'fe_groups',
43  'creator',
44  'creator_tool',
45  'publisher',
46  'source',
47  'copyright',
48  'location_country',
49  'location_region',
50  'location_city',
51  'categories',
52  ],
54  'title',
55  'description',
56  'ranking',
57  'keywords',
58  'caption',
59  'download_name',
60  'visible',
61  'status',
62  'fe_groups',
63  'creator',
64  'creator_tool',
65  'publisher',
66  'source',
67  'copyright',
68  'language',
69  'location_country',
70  'location_region',
71  'location_city',
72  'categories',
73  ],
75  'title',
76  'description',
77  'ranking',
78  'keywords',
79  'alternative',
80  'caption',
81  'download_name',
82  'visible',
83  'status',
84  'fe_groups',
85  'creator',
86  'creator_tool',
87  'publisher',
88  'source',
89  'copyright',
90  'language',
91  'location_country',
92  'location_region',
93  'location_city',
94  'latitude',
95  'longitude',
96  'content_creation_date',
97  'content_modification_date',
98  'categories',
99  ],
101  'title',
102  'description',
103  'ranking',
104  'keywords',
105  'caption',
106  'download_name',
107  'visible',
108  'status',
109  'fe_groups',
110  'creator',
111  'creator_tool',
112  'publisher',
113  'source',
114  'copyright',
115  'language',
116  'content_creation_date',
117  'content_modification_date',
118  'duration',
119  'categories',
120  ],
122  'title',
123  'description',
124  'ranking',
125  'keywords',
126  'caption',
127  'download_name',
128  'visible',
129  'status',
130  'fe_groups',
131  'creator',
132  'creator_tool',
133  'publisher',
134  'source',
135  'copyright',
136  'language',
137  'content_creation_date',
138  'content_modification_date',
139  'duration',
140  'categories',
141  ],
142  ];
143 
148  {
149  $this->setUpBackendUserFromFixture(1);
150  $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
151  $GLOBALS['TCA']['sys_file_metadata']['ctrl']['type'] = 'fileype';
152 
153  $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
154 
155  foreach (static::$fileMetadataFields as $filetype => $expectedFields) {
156  $formResult = $formEngineTestService->createNewRecordForm(
157  'sys_file_metadata',
158  ['fileype' => $filetype]
159  );
160 
161  foreach ($expectedFields as $expectedField) {
162  $this->assertNotFalse(
163  $formEngineTestService->formHtmlContainsField($expectedField, $formResult['html']),
164  'The field ' . $expectedField . ' is not in the form HTML for file type ' . $filetype
165  );
166  }
167  }
168  }
169 }
static makeInstance($className,... $constructorArguments)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']