‪TYPO3CMS  ‪main
PagesAndTtContentWithRteImagesAndFileLinkTest.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;
25 
27 {
28  protected array ‪$additionalFoldersToCreate = [
29  '/fileadmin/_processed_',
30  ];
31 
32  #[Test]
34  {
35  $subject = GeneralUtility::makeInstance(Import::class);
36  $subject->setPid(0);
37 
38  $subject->loadFile('EXT:impexp/Tests/Functional/Fixtures/XmlImports/pages-and-ttcontent-with-rte-image-n-file-link.xml');
39  $subject->importData();
40 
41  $this->testFilesToDelete[] = ‪Environment::getPublicPath() . '/fileadmin/user_upload/typo3_image2.jpg';
42  $this->testFilesToDelete[] = ‪Environment::getPublicPath() . '/fileadmin/user_upload/typo3_image3.jpg';
43 
44  $this->assertCSVDataSet(__DIR__ . '/../Fixtures/DatabaseAssertions/importPagesAndRelatedTtContentWithRteImagesAndFileLink.csv');
45 
46  self::assertFileDoesNotExist(‪Environment::getPublicPath() . '/fileadmin/_processed_/csm_typo3_image2_5c2670fd59.jpg');
47 
48  self::assertFileEquals(__DIR__ . '/../Fixtures/Folders/fileadmin/user_upload/typo3_image2.jpg', ‪Environment::getPublicPath() . '/fileadmin/user_upload/typo3_image2.jpg');
49  self::assertFileEquals(__DIR__ . '/../Fixtures/Folders/fileadmin/user_upload/typo3_image3.jpg', ‪Environment::getPublicPath() . '/fileadmin/user_upload/typo3_image3.jpg');
50  }
51 }
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static getPublicPath()
Definition: Environment.php:187
‪TYPO3\CMS\Impexp\Tests\Functional\Import
Definition: ImagesWithStoragesTest.php:18
‪TYPO3\CMS\Impexp\Import
Definition: Import.php:51
‪TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithRteImagesAndFileLinkTest\$additionalFoldersToCreate
‪array $additionalFoldersToCreate
Definition: PagesAndTtContentWithRteImagesAndFileLinkTest.php:28
‪TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithRteImagesAndFileLinkTest\importPagesAndRelatedTtContentWithRteImagesAndFileLink
‪importPagesAndRelatedTtContentWithRteImagesAndFileLink()
Definition: PagesAndTtContentWithRteImagesAndFileLinkTest.php:33
‪TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase
Definition: AbstractImportExportTestCase.php:33
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithRteImagesAndFileLinkTest
Definition: PagesAndTtContentWithRteImagesAndFileLinkTest.php:27
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52