‪TYPO3CMS  11.5
PagesAndTtContentTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 
24 {
26  'typo3/sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload' => 'fileadmin/user_upload',
27  ];
28 
30  'typo3/sysext/impexp/Tests/Functional/Fixtures/Extensions/template_extension',
31  ];
32 
33  protected array ‪$recordTypesIncludeFields =
34  [
35  'pages' => [
36  'title',
37  'deleted',
38  'doktype',
39  'hidden',
40  'perms_everybody',
41  ],
42  'tt_content' => [
43  'CType',
44  'header',
45  'header_link',
46  'deleted',
47  'hidden',
48  't3ver_oid',
49  ],
50  'sys_file' => [
51  'storage',
52  'type',
53  'metadata',
54  'identifier',
55  'identifier_hash',
56  'folder_hash',
57  'mime_type',
58  'name',
59  'sha1',
60  'size',
61  'creation_date',
62  'modification_date',
63  ],
64  ]
65  ;
66 
67  protected function ‪setUp(): void
68  {
69  parent::setUp();
70 
71  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/pages.csv');
72  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/tt_content.csv');
73  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file.csv');
74  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file-export-pages-and-tt-content.csv');
75  }
76 
80  public function ‪exportPagesAndRelatedTtContent(): void
81  {
82  $subject = $this->getAccessibleMock(Export::class, ['setMetaData']);
83  $subject->setPid(1);
84  $subject->setLevels(1);
85  $subject->setTables(['_ALL']);
86  $subject->setRelOnlyTables(['sys_file']);
87  $subject->setRecordTypesIncludeFields($this->recordTypesIncludeFields);
88  $subject->process();
89 
90  $out = $subject->render();
91 
92  // @todo Use self::assertXmlStringEqualsXmlFile() instead when sqlite issue is sorted out
94  __DIR__ . '/../Fixtures/XmlExports/pages-and-ttcontent.xml',
95  $out
96  );
97  }
98 
103  {
104  $subject = $this->getAccessibleMock(Export::class, ['setMetaData']);
105  $subject->setPid(1);
106  $subject->setExcludeMap(['pages:2' => 1]);
107  $subject->setLevels(1);
108  $subject->setTables(['_ALL']);
109  $subject->setRelOnlyTables(['sys_file']);
110  $subject->setRecordTypesIncludeFields($this->recordTypesIncludeFields);
111  $subject->setExcludeDisabledRecords(true);
112  $subject->process();
113 
114  $out = $subject->render();
115 
116  // @todo Use self::assertXmlStringEqualsXmlFile() instead when sqlite issue is sorted out
118  __DIR__ . '/../Fixtures/XmlExports/pages-and-ttcontent-complex.xml',
119  $out
120  );
121  }
122 }
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$recordTypesIncludeFields
‪array $recordTypesIncludeFields
Definition: PagesAndTtContentTest.php:33
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$pathsToLinkInTestInstance
‪$pathsToLinkInTestInstance
Definition: PagesAndTtContentTest.php:25
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\setUp
‪setUp()
Definition: PagesAndTtContentTest.php:67
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase\assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger
‪assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger(string $expectedFile, string $actualXml)
Definition: AbstractImportExportTestCase.php:105
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest
Definition: PagesAndTtContentTest.php:24
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\exportPagesAndRelatedTtContentWithComplexConfiguration
‪exportPagesAndRelatedTtContentWithComplexConfiguration()
Definition: PagesAndTtContentTest.php:102
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: PagesAndTtContentTest.php:29
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\exportPagesAndRelatedTtContent
‪exportPagesAndRelatedTtContent()
Definition: PagesAndTtContentTest.php:80
‪TYPO3\CMS\Impexp\Tests\Functional\Export
Definition: ExportControllerTest.php:18
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase
Definition: AbstractImportExportTestCase.php:34
‪TYPO3\CMS\Impexp\Export
Definition: Export.php:48