‪TYPO3CMS  ‪main
FlexFormProcessorTest.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;
22 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
25 final class ‪FlexFormProcessorTest extends FunctionalTestCase
26 {
28 
32  protected const ‪LANGUAGE_PRESETS = [
33  'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'],
34  ];
35 
36  protected array ‪$additionalFoldersToCreate = [
37  'fileadmin/user_upload',
38  ];
39 
40  protected array ‪$pathsToProvideInTestInstance = [
41  'typo3/sysext/frontend/Tests/Functional/Fixtures/Images/typo3-logo.png' => 'fileadmin/user_upload/typo3-logo.png',
42  ];
43 
44  protected array ‪$testExtensionsToLoad = [
45  'typo3/sysext/frontend/Tests/Functional/Fixtures/Extensions/test_fluid_template',
46  ];
47 
48  public function ‪setUp(): void
49  {
50  parent::setUp();
51  $this->importCSVDataSet(__DIR__ . '/../Fixtures/sys_file_storage.csv');
52  $this->importCSVDataSet(__DIR__ . '/DataSet/FlexformDataProcessor.csv');
53 
55  'test',
56  $this->‪buildSiteConfiguration(1, '/'),
57  );
58  }
59 
60  #[Test]
61  public function ‪referencedImageWillGetResolved(): void
62  {
63  $this->setUpFrontendRootPage(
64  1,
65  ['EXT:frontend/Tests/Functional/Fixtures/Extensions/test_fluid_template/Configuration/TypoScript/flexform_dataprocessor.typoscript']
66  );
67 
68  $response = $this->executeFrontendSubRequest((new InternalRequest('https://website.local/'))->withPageId(1));
69  $body = (string)$response->getBody();
70  self::assertStringContainsString('<img src="/fileadmin/user_upload/typo3-logo.png" width="238" height="100" alt="" title="TYPO3 Logo" />', $body);
71  }
72 }
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\referencedImageWillGetResolved
‪referencedImageWillGetResolved()
Definition: FlexFormProcessorTest.php:60
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing
Definition: FlexFormProcessorTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait
Definition: SiteBasedTestTrait.php:37
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:50
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:88
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest
Definition: FlexFormProcessorTest.php:26
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\$pathsToProvideInTestInstance
‪array $pathsToProvideInTestInstance
Definition: FlexFormProcessorTest.php:39
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\LANGUAGE_PRESETS
‪const LANGUAGE_PRESETS
Definition: FlexFormProcessorTest.php:31
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: FlexFormProcessorTest.php:43
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\$additionalFoldersToCreate
‪array $additionalFoldersToCreate
Definition: FlexFormProcessorTest.php:35
‪TYPO3\CMS\Frontend\Tests\Functional\DataProcessing\FlexFormProcessorTest\setUp
‪setUp()
Definition: FlexFormProcessorTest.php:47