‪TYPO3CMS  11.5
ImportExportTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use PHPUnit\Framework\MockObject\MockObject;
22 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
23 
25 {
27  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_csv',
28  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_mm',
29  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_mnsymmetric',
30  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_foreignfield',
31  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_mnattributeinline',
32  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_mnattributesimple',
33  ];
34 
38  protected ‪$exportMock;
39 
40  protected function ‪setUp(): void
41  {
42  parent::setUp();
43  $this->exportMock = $this->getAccessibleMock(Export::class, ['setMetaData']);
44  }
45 
49  public function ‪importExportPingPongSucceeds(): void
50  {
51  $recordTypesIncludeFields = include __DIR__ . '/Fixtures/IrreRecordsIncludeFields.php';
52 
53  $import = GeneralUtility::makeInstance(Import::class);
54  $import->setPid(0);
55  $import->loadFile(
56  'EXT:impexp/Tests/Functional/Fixtures/XmlImports/irre-records.xml',
57  1
58  );
59  $import->setForceAllUids(true);
60  $import->importData();
61 
62  $this->exportMock->setPid(1);
63  $this->exportMock->setLevels(‪Export::LEVELS_INFINITE);
64  $this->exportMock->setTables(['_ALL']);
65  $this->exportMock->setRelOnlyTables(['_ALL']);
66  $this->exportMock->setRecordTypesIncludeFields($recordTypesIncludeFields);
67  $this->exportMock->process();
68  $actual = $this->exportMock->render();
69 
70  // @todo Use self::assertXmlStringEqualsXmlFile() instead when sqlite issue is sorted out
72  __DIR__ . '/Fixtures/XmlImports/irre-records.xml',
73  $actual
74  );
75  }
76 }
‪TYPO3\CMS\Impexp\Tests\Functional\ImportExportTest\importExportPingPongSucceeds
‪importExportPingPongSucceeds()
Definition: ImportExportTest.php:48
‪TYPO3\CMS\Impexp\Tests\Functional\ImportExportTest
Definition: ImportExportTest.php:25
‪TYPO3\CMS\Impexp\Tests\Functional
Definition: AbstractImportExportTestCase.php:18
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase\assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger
‪assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger(string $expectedFile, string $actualXml)
Definition: AbstractImportExportTestCase.php:105
‪TYPO3\CMS\Impexp\Export\LEVELS_INFINITE
‪const LEVELS_INFINITE
Definition: Export.php:51
‪TYPO3\CMS\Impexp\Tests\Functional\ImportExportTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: ImportExportTest.php:26
‪TYPO3\CMS\Impexp\Tests\Functional\ImportExportTest\$exportMock
‪Export MockObject AccessibleObjectInterface $exportMock
Definition: ImportExportTest.php:37
‪TYPO3\CMS\Impexp\Import
Definition: Import.php:50
‪TYPO3\CMS\Impexp\Tests\Functional\ImportExportTest\setUp
‪setUp()
Definition: ImportExportTest.php:39
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase
Definition: AbstractImportExportTestCase.php:34
‪TYPO3\CMS\Impexp\Export
Definition: Export.php:48
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50