‪TYPO3CMS  ‪main
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 
20 use PHPUnit\Framework\Attributes\Test;
23 
25 {
26  protected array ‪$pathsToLinkInTestInstance = [
27  'typo3/sysext/impexp/Tests/Functional/Fixtures/Folders/fileadmin/user_upload' => 'fileadmin/user_upload',
28  ];
29 
30  protected array ‪$testExtensionsToLoad = [
31  'typo3/sysext/impexp/Tests/Functional/Fixtures/Extensions/template_extension',
32  ];
33 
34  protected array ‪$recordTypesIncludeFields =
35  [
36  'pages' => [
37  'title',
38  'deleted',
39  'doktype',
40  'hidden',
41  'perms_everybody',
42  ],
43  'tt_content' => [
44  'CType',
45  'header',
46  'header_link',
47  'deleted',
48  'hidden',
49  't3ver_oid',
50  ],
51  'sys_file' => [
52  'storage',
53  'type',
54  'metadata',
55  'identifier',
56  'identifier_hash',
57  'folder_hash',
58  'mime_type',
59  'name',
60  'sha1',
61  'size',
62  'creation_date',
63  'modification_date',
64  ],
65  ]
66  ;
67 
68  protected function ‪setUp(): void
69  {
70  parent::setUp();
71 
72  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/pages.csv');
73  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/tt_content.csv');
74  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file.csv');
75  $this->importCSVDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file-export-pages-and-tt-content.csv');
76  }
77 
78  #[Test]
79  public function ‪exportPagesAndRelatedTtContent(): void
80  {
81  $subject = $this->getAccessibleMock(Export::class, ['setMetaData']);
82  $subject->setPid(1);
83  $subject->setLevels(1);
84  $subject->setTables(['_ALL']);
85  $subject->setRelOnlyTables(['sys_file']);
86  $subject->setRecordTypesIncludeFields($this->recordTypesIncludeFields);
87  $subject->process();
88 
89  $out = $subject->render();
90 
91  // @todo Use self::assertXmlStringEqualsXmlFile() instead when sqlite issue is sorted out
93  __DIR__ . '/../Fixtures/XmlExports/pages-and-ttcontent.xml',
94  $out
95  );
96  }
97 
98  #[Test]
100  {
101  $subject = $this->getAccessibleMock(Export::class, ['setMetaData']);
102  $subject->setPid(1);
103  $subject->setExcludeMap(['pages:2' => 1]);
104  $subject->setLevels(1);
105  $subject->setTables(['_ALL']);
106  $subject->setRelOnlyTables(['sys_file']);
107  $subject->setRecordTypesIncludeFields($this->recordTypesIncludeFields);
108  $subject->setExcludeDisabledRecords(true);
109  $subject->process();
110 
111  $out = $subject->render();
112 
113  // @todo Use self::assertXmlStringEqualsXmlFile() instead when sqlite issue is sorted out
115  __DIR__ . '/../Fixtures/XmlExports/pages-and-ttcontent-complex.xml',
116  $out
117  );
118  }
119 }
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: PagesAndTtContentTest.php:30
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$recordTypesIncludeFields
‪array $recordTypesIncludeFields
Definition: PagesAndTtContentTest.php:34
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\$pathsToLinkInTestInstance
‪array $pathsToLinkInTestInstance
Definition: PagesAndTtContentTest.php:26
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\setUp
‪setUp()
Definition: PagesAndTtContentTest.php:68
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase\assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger
‪assertXmlStringEqualsXmlFileWithIgnoredSqliteTypeInteger(string $expectedFile, string $actualXml)
Definition: AbstractImportExportTestCase.php:92
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest
Definition: PagesAndTtContentTest.php:25
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\exportPagesAndRelatedTtContentWithComplexConfiguration
‪exportPagesAndRelatedTtContentWithComplexConfiguration()
Definition: PagesAndTtContentTest.php:99
‪TYPO3\CMS\Impexp\Tests\Functional\Export\PagesAndTtContentTest\exportPagesAndRelatedTtContent
‪exportPagesAndRelatedTtContent()
Definition: PagesAndTtContentTest.php:79
‪TYPO3\CMS\Impexp\Tests\Functional\Export
Definition: IrreRecordsTest.php:18
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase
Definition: AbstractImportExportTestCase.php:33
‪TYPO3\CMS\Impexp\Export
Definition: Export.php:52