[CLEANUP] Remove obsolete require_once from test files
[Packages/TYPO3.CMS.git] / typo3 / sysext / impexp / Tests / Functional / Export / IrreTutorialRecords / ExportTest.php
1 <?php
2 namespace TYPO3\CMS\Impexp\Tests\Functional\Export\IrreTutorialRecords;
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
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18
19 /**
20 * Functional test for the ImportExport
21 */
22 class ExportTest extends \TYPO3\CMS\Impexp\Tests\Functional\Export\AbstractExportTestCase {
23
24 /**
25 * @var array
26 */
27 protected $testExtensionsToLoad = array(
28 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial',
29 );
30
31 protected function setUp() {
32 parent::setUp();
33
34 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/irre_tutorial.xml');
35 }
36
37 /**
38 * @test
39 */
40 public function exportIrreRecords() {
41
42 $recordTypesIncludeFields = array(
43 'pages' => array(
44 'title',
45 'deleted',
46 'doktype',
47 'hidden',
48 'perms_everybody'
49 ),
50 'tt_content' => array(
51 'CType',
52 'header',
53 'deleted',
54 'hidden',
55 't3ver_oid',
56 'tx_irretutorial_1nff_hotels',
57 'tx_irretutorial_1ncsv_hotels'
58 ),
59 'tx_irretutorial_1ncsv_hotel' => array(
60 'cruser_id',
61 'sys_language_uid',
62 'l18n_parent',
63 'sorting',
64 'deleted',
65 'hidden',
66 'title',
67 'offers',
68 ),
69 'tx_irretutorial_1ncsv_offer' => array(
70 'cruser_id',
71 'sys_language_uid',
72 'l18n_parent',
73 'sorting',
74 'deleted',
75 'hidden',
76 'title',
77 'prices',
78 ),
79 'tx_irretutorial_1ncsv_price' => array(
80 'cruser_id',
81 'sys_language_uid',
82 'l18n_parent',
83 'sorting',
84 'deleted',
85 'hidden',
86 'title',
87 'price',
88 ),
89 'tx_irretutorial_1nff_hotel' => array(
90 'cruser_id',
91 'sys_language_uid',
92 'l18n_parent',
93 'sorting',
94 'deleted',
95 'hidden',
96 'parentid',
97 'parenttable',
98 'parentidentifier',
99 'title',
100 'offers',
101 ),
102 'tx_irretutorial_1nff_offer' => array(
103 'cruser_id',
104 'sys_language_uid',
105 'l18n_parent',
106 'sorting',
107 'deleted',
108 'hidden',
109 'parentid',
110 'parenttable',
111 'parentidentifier',
112 'title',
113 'prices',
114 ),
115 'tx_irretutorial_1nff_price' => array(
116 'cruser_id',
117 'sys_language_uid',
118 'l18n_parent',
119 'sorting',
120 'deleted',
121 'hidden',
122 'parentid',
123 'parenttable',
124 'parentidentifier',
125 'title',
126 'price',
127 ),
128 'tx_irretutorial_mnasym_hotel' => array(
129 'cruser_id',
130 'sys_language_uid',
131 'l18n_parent',
132 'sorting',
133 'deleted',
134 'hidden',
135 'title',
136 'offers',
137 ),
138 'tx_irretutorial_mnasym_hotel_offer_rel' => array(
139 'cruser_id',
140 'sys_language_uid',
141 'l18n_parent',
142 'deleted',
143 'hidden',
144 'hotelid',
145 'offerid',
146 'hotelsort',
147 'offersort',
148 'prices',
149 ),
150 'tx_irretutorial_mnasym_offer' => array(
151 'cruser_id',
152 'sys_language_uid',
153 'l18n_parent',
154 'sorting',
155 'deleted',
156 'hidden',
157 'title',
158 'hotels',
159 ),
160 'tx_irretutorial_mnasym_price' => array(
161 'cruser_id',
162 'sys_language_uid',
163 'l18n_parent',
164 'sorting',
165 'deleted',
166 'hidden',
167 'parentid',
168 'title',
169 'price',
170 ),
171 'tx_irretutorial_mnattr_hotel' => array(
172 'cruser_id',
173 'sys_language_uid',
174 'l18n_parent',
175 'sorting',
176 'deleted',
177 'hidden',
178 'title',
179 'offers',
180 ),
181 'tx_irretutorial_mnattr_hotel_offer_rel' => array(
182 'cruser_id',
183 'sys_language_uid',
184 'l18n_parent',
185 'deleted',
186 'hidden',
187 'hotelid',
188 'offerid',
189 'hotelsort',
190 'offersort',
191 'quality',
192 'allincl',
193 ),
194 'tx_irretutorial_mnattr_offer' => array(
195 'cruser_id',
196 'sys_language_uid',
197 'l18n_parent',
198 'sorting',
199 'deleted',
200 'hidden',
201 'title',
202 'hotels',
203 ),
204 'tx_irretutorial_mnmmasym_hotel' => array(
205 'cruser_id',
206 'sys_language_uid',
207 'l18n_parent',
208 'sorting',
209 'deleted',
210 'hidden',
211 'title',
212 'offers',
213 ),
214 'tx_irretutorial_mnmmasym_hotel_offer_rel' => array(
215 'uid_local',
216 'uid_foreign',
217 'tablenames',
218 'sorting',
219 'sorting_foreign',
220 'ident',
221 ),
222 'tx_irretutorial_mnmmasym_offer' => array(
223 'cruser_id',
224 'sys_language_uid',
225 'l18n_parent',
226 'sorting',
227 'deleted',
228 'hidden',
229 'title',
230 'hotels',
231 'prices',
232 ),
233 'tx_irretutorial_mnmmasym_offer_price_rel' => array(
234 'uid_local',
235 'uid_foreign',
236 'tablenames',
237 'sorting',
238 'sorting_foreign',
239 'ident',
240 ),
241 'tx_irretutorial_mnmmasym_price' => array(
242 'cruser_id',
243 'sys_language_uid',
244 'l18n_parent',
245 'sorting',
246 'deleted',
247 'hidden',
248 'title',
249 'price',
250 'offers',
251 ),
252 'tx_irretutorial_mnsym_hotel' => array(
253 'cruser_id',
254 'sys_language_uid',
255 'l18n_parent',
256 'sorting',
257 'deleted',
258 'hidden',
259 'title',
260 'branches',
261 ),
262 'tx_irretutorial_mnsym_hotel_rel' => array(
263 'cruser_id',
264 'sys_language_uid',
265 'l18n_parent',
266 'deleted',
267 'hidden',
268 'hotelid',
269 'branchid',
270 'hotelsort',
271 'branchsort',
272 )
273
274 );
275
276 $this->export->setRecordTypesIncludeFields($recordTypesIncludeFields);
277
278 $this->export->export_addRecord('pages', BackendUtility::getRecord('pages', 1));
279 $this->addRecordsForPid(1, array_keys($recordTypesIncludeFields));
280
281 $this->setPageTree(1);
282
283 // After adding ALL records we set relations:
284 for ($a = 0; $a < 10; $a++) {
285 $addR = $this->export->export_addDBRelations($a);
286 if (empty($addR)) {
287 break;
288 }
289 }
290
291 $this->export->export_addFilesFromRelations();
292 $this->export->export_addFilesFromSysFilesRecords();
293
294 $out = $this->export->compileMemoryToFileContent('xml');
295
296 $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/irre-records.xml', $out);
297 }
298
299 }