TYPO3  7.6
PagesAndTtContentWithImages/ImportInEmptyDatabaseTest.php
Go to the documentation of this file.
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 
21 {
22  protected $assertionDataSetDirectory = 'typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/';
23 
24 
25 
30  {
31  if (!$this->isCaseSensitiveFilesystem()) {
32  $this->markTestSkipped('Test not available on case insensitive filesystems.');
33  }
34 
35  $this->import->loadFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml', 1);
36  $this->import->importData(0);
37 
38  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesOnCaseSensitiveFilesystems');
39 
40  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
41  }
42 
47  {
48  if ($this->isCaseSensitiveFilesystem()) {
49  $this->markTestSkipped('Test not available on case sensitive filesystems.');
50  }
51 
52  $this->import->loadFile(__DIR__ . '/../../Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml', 1);
53  $this->import->importData(0);
54 
55  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesOnCaseInsensitiveFilesystems');
56 
57  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
58  }
59 
64  {
65  if (!$this->isCaseSensitiveFilesystem()) {
66  $this->markTestSkipped('Test not available on case insensitive filesystems.');
67  }
68 
69  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-without-storage.xml', 1);
70  $this->import->importData(0);
71 
72  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseSensitiveFilesystems');
73 
74  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
75  }
76 
81  {
82  if ($this->isCaseSensitiveFilesystem()) {
83  $this->markTestSkipped('Test not available on case sensitive filesystems.');
84  }
85 
86  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-without-storage.xml', 1);
87  $this->import->importData(0);
88 
89  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButWithoutStorageOnCaseInsensitiveFilesystems');
90 
91  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
92  }
93 
98  {
99  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-with-spaces-in-path.xml', 1);
100  $this->import->importData(0);
101 
102  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesWithSpacesInPath');
103 
104  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/folder_with_spaces/typo3_image2.jpg');
105  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image3.jpg', PATH_site . 'fileadmin/user_upload/folder_with_spaces/typo3_image3.jpg');
106  }
107 
112  {
113  $this->import->loadFile(PATH_site . 'typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml', 1);
114  $this->import->importData(0);
115 
116  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImagesButNotIncluded');
117 
118  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
119  }
120 
125  {
126  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-image-with-forced-uids.xml', 1);
127  $this->import->force_all_UIDS = true;
128  $this->import->importData(0);
129 
130  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithImageWithForcedUids');
131 
132  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
133 
134  $expectedErrors = array(
135  'Forcing uids of sys_file records is not supported! They will be imported as new records!'
136  );
137  $errors = $this->import->errorLog;
138  $this->assertSame($expectedErrors, $errors);
139  }
140 }