[TASK] Removes extra empty lines
[Packages/TYPO3.CMS.git] / typo3 / sysext / impexp / Tests / Functional / Import / PagesAndTtContentWithImages / ImportInEmptyDatabaseTest.php
1 <?php
2 namespace TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithImages;
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 /**
18 * Functional test for the ImportExport
19 */
20 class ImportInEmptyDatabaseTest extends \TYPO3\CMS\Impexp\Tests\Functional\Import\AbstractImportTestCase
21 {
22 protected $assertionDataSetDirectory = 'typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/';
23
24 /**
25 * @test
26 */
27 public function importPagesAndRelatedTtContentWithImagesOnCaseSensitiveFilesystems()
28 {
29 if (!$this->isCaseSensitiveFilesystem()) {
30 $this->markTestSkipped('Test not available on case insensitive filesystems.');
31 }
32
33 $this->import->loadFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml', 1);
34 $this->import->importData(0);
35
36 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesOnCaseSensitiveFilesystems');
37
38 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
39 }
40
41 /**
42 * @test
43 */
44 public function importPagesAndRelatedTtContentWithImagesOnCaseInsensitiveFilesystems()
45 {
46 if ($this->isCaseSensitiveFilesystem()) {
47 $this->markTestSkipped('Test not available on case sensitive filesystems.');
48 }
49
50 $this->import->loadFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml', 1);
51 $this->import->importData(0);
52
53 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesOnCaseInsensitiveFilesystems');
54
55 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
56 }
57
58 /**
59 * @test
60 */
61 public function importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseSensitiveFilesystems()
62 {
63 if (!$this->isCaseSensitiveFilesystem()) {
64 $this->markTestSkipped('Test not available on case insensitive filesystems.');
65 }
66
67 $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-without-storage.xml', 1);
68 $this->import->importData(0);
69
70 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseSensitiveFilesystems');
71
72 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
73 }
74
75 /**
76 * @test
77 */
78 public function importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseInsensitiveFilesystems()
79 {
80 if ($this->isCaseSensitiveFilesystem()) {
81 $this->markTestSkipped('Test not available on case sensitive filesystems.');
82 }
83
84 $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-without-storage.xml', 1);
85 $this->import->importData(0);
86
87 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseInsensitiveFilesystems');
88
89 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
90 }
91
92 /**
93 * @test
94 */
95 public function importPagesAndRelatedTtContentWithImagesWithSpacesInPath()
96 {
97 $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-with-spaces-in-path.xml', 1);
98 $this->import->importData(0);
99
100 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesWithSpacesInPath');
101
102 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/folder_with_spaces/typo3_image2.jpg');
103 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image3.jpg', PATH_site . 'fileadmin/user_upload/folder_with_spaces/typo3_image3.jpg');
104 }
105
106 /**
107 * @test
108 */
109 public function importPagesAndRelatedTtContentWithImagesButNotIncluded()
110 {
111 $this->import->loadFile(PATH_site . 'typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml', 1);
112 $this->import->importData(0);
113
114 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButNotIncluded');
115
116 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
117 }
118
119 /**
120 * @test
121 */
122 public function importPagesAndRelatedTtContentWithImageWithForcedUids()
123 {
124 $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-with-forced-uids.xml', 1);
125 $this->import->force_all_UIDS = true;
126 $this->import->importData(0);
127
128 $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImageWithForcedUids');
129
130 $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
131
132 $expectedErrors = array(
133 'Forcing uids of sys_file records is not supported! They will be imported as new records!'
134 );
135 $errors = $this->import->errorLog;
136 $this->assertSame($expectedErrors, $errors);
137 }
138 }