TYPO3 CMS  TYPO3_6-2
ImportInFilledDatabaseTest.php
Go to the documentation of this file.
1 <?php
3 
17 require_once __DIR__ . '/../AbstractImportTestCase.php';
18 
23 
24  protected $additionalFoldersToCreate = array(
25  '/fileadmin/user_upload'
26  );
27 
28  protected $pathsToLinkInTestInstance = array(
29  'typo3/sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg' => 'fileadmin/user_upload/typo3_image2.jpg',
30  );
31 
32  protected $assertionDataSetDirectory = 'typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/DataSet/Assertion/';
33 
38 
39  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/pages.xml');
40  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/tt_content-with-image.xml');
41  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_language.xml');
42  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file.xml');
43  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_metadata.xml');
44  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_reference.xml');
45  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_storage.xml');
46 
47  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-existing-different-image.xml', 1);
48  $this->import->importData(0);
49 
50  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithDifferentImageToExistingData');
51 
52  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
53  $this->assertFileEquals(__DIR__ . '/Folders/Assertion/fileadmin/user_upload/typo3_image2_01.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2_01.jpg');
54 
55  }
56 
61 
62  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/pages.xml');
63  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/tt_content-with-image.xml');
64  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_language.xml');
65  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file.xml');
66  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_metadata.xml');
67  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_reference.xml');
68  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/sys_file_storage.xml');
69 
70  $this->import->loadFile(__DIR__ . '/ImportExportXml/pages-and-ttcontent-with-existing-same-image.xml', 1);
71  $this->import->importData(0);
72 
73  $this->assertAssertionDataSet('importPagesAndRelatedTtContentWithSameImageToExistingData');
74 
75  $this->assertFileEquals(__DIR__ . '/../../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', PATH_site . 'fileadmin/user_upload/typo3_image2.jpg');
76 
77  }
78 
79 
80 }