‪TYPO3CMS  11.5
TypoScriptFrontendControllerWithFrontendTest.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 
21 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
22 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
23 
24 class ‪TypoScriptFrontendControllerWithFrontendTest extends FunctionalTestCase
25 {
27 
28  protected const ‪LANGUAGE_PRESETS = [
29  'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'],
30  ];
31 
35  public function ‪jsIncludesWithUserIntIsRendered(): void
36  {
37  $this->importCSVDataSet(__DIR__ . '/DataSet/LiveDefaultPages.csv');
38  $this->setUpFrontendRootPage(
39  2,
40  [
41  'typo3/sysext/frontend/Tests/Functional/Controller/Fixtures/jsInline.typoscript',
42  ]
43  );
45  'test',
46  $this->‪buildSiteConfiguration(2, 'https://website.local/'),
47  [$this->‪buildDefaultLanguageConfiguration('EN', '/en/')]
48  );
49 
50  $response = $this->executeFrontendSubRequest(
51  (new InternalRequest('https://website.local/en/'))->withPageId(2)
52  );
53 
54  $body = (string)$response->getBody();
55  self::assertStringContainsString('/*TS_inlineJSint*/
56 alert(yes);', $body);
57  }
58 }
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait
Definition: SiteBasedTestTrait.php:36
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:58
‪TYPO3\CMS\Frontend\Tests\Functional\Controller\TypoScriptFrontendControllerWithFrontendTest\jsIncludesWithUserIntIsRendered
‪jsIncludesWithUserIntIsRendered()
Definition: TypoScriptFrontendControllerWithFrontendTest.php:34
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildDefaultLanguageConfiguration
‪array buildDefaultLanguageConfiguration(string $identifier, string $base)
Definition: SiteBasedTestTrait.php:126
‪TYPO3\CMS\Frontend\Tests\Functional\Controller
Definition: TypoScriptFrontendControllerTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪array buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:111
‪TYPO3\CMS\Frontend\Tests\Functional\Controller\TypoScriptFrontendControllerWithFrontendTest\LANGUAGE_PRESETS
‪const LANGUAGE_PRESETS
Definition: TypoScriptFrontendControllerWithFrontendTest.php:27
‪TYPO3\CMS\Frontend\Tests\Functional\Controller\TypoScriptFrontendControllerWithFrontendTest
Definition: TypoScriptFrontendControllerWithFrontendTest.php:25