[CLEANUP] Remove obsolete require_once from test files
[Packages/TYPO3.CMS.git] / typo3 / sysext / impexp / Tests / Functional / Export / PagesAndTtContentWithRteImagesAndFileLink / ExportTest.php
1 <?php
2 namespace TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentWithRteImagesAndFileLink;
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 $coreExtensionsToLoad = array(
28 'rtehtmlarea',
29 'impexp'
30 );
31
32 /**
33 * @var array
34 */
35 protected $pathsToLinkInTestInstance = array(
36 'typo3/sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload' => 'fileadmin/user_upload',
37 'typo3/sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/_processed_' => 'fileadmin/_processed_'
38 );
39
40 protected function setUp() {
41 parent::setUp();
42
43 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/pages.xml');
44 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/tt_content-with-rte-image-n-file-link.xml');
45 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file.xml');
46 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_reference.xml');
47 $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_storage.xml');
48
49 }
50
51 /**
52 * @test
53 */
54 public function exportPagesAndRelatedTtContentWithRteImagesAndFileLink() {
55
56 $this->export->setRecordTypesIncludeFields(
57 array(
58 'pages' => array(
59 'title',
60 'deleted',
61 'doktype',
62 'hidden',
63 'perms_everybody'
64 ),
65 'tt_content' => array(
66 'CType',
67 'header',
68 'deleted',
69 'hidden',
70 'bodytext',
71 't3ver_oid'
72 ),
73 'sys_file' => array(
74 'storage',
75 'type',
76 'metadata',
77 'identifier',
78 'identifier_hash',
79 'folder_hash',
80 'extension',
81 'mime_type',
82 'name',
83 'sha1',
84 'size',
85 'creation_date',
86 'modification_date',
87 ),
88 'sys_file_storage' => array(
89 'name',
90 'description',
91 'driver',
92 'configuration',
93 'is_default',
94 'is_browsable',
95 'is_public',
96 'is_writable',
97 'is_online'
98 )
99 )
100 );
101
102 $this->export->relOnlyTables = array(
103 'sys_file',
104 'sys_file_storage'
105 );
106
107 $this->export->export_addRecord('pages', BackendUtility::getRecord('pages', 1));
108 $this->export->export_addRecord('pages', BackendUtility::getRecord('pages', 2));
109 $this->export->export_addRecord('tt_content', BackendUtility::getRecord('tt_content', 1));
110
111 $this->setPageTree(1, 1);
112
113 // After adding ALL records we set relations:
114 for ($a = 0; $a < 10; $a++) {
115 $addR = $this->export->export_addDBRelations($a);
116 if (empty($addR)) {
117 break;
118 }
119 }
120
121 $this->export->export_addFilesFromRelations();
122 $this->export->export_addFilesFromSysFilesRecords();
123
124 $out = $this->export->compileMemoryToFileContent('xml');
125
126 $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-rte-image-n-file-link.xml', $out);
127 }
128
129 }