‪TYPO3CMS  11.5
TypoScriptParserTest.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\FunctionalTestCase;
22 
23 class ‪TypoScriptParserTest extends FunctionalTestCase
24 {
28  protected ‪$initializeDatabase = false;
29 
36  public function ‪hasFlakyReferences(): void
37  {
38  $typoScript = implode(LF, [
39  '',
40  '[GLOBAL]',
41  'RTE.default.proc.entryHTMLparser_db = 1',
42  'RTE.default.proc.entryHTMLparser_db {',
43  'tags {',
44  '}',
45  '}',
46 
47  'RTE.default.FE < RTE.default',
48 
49  'RTE.default.anyOtherOption = 1',
50  'RTE.default.anyOtherOption.HTMLparser < RTE.default.proc.entryHTMLparser_db',
51  '',
52  ]);
53 
54  $typoScriptParser = new ‪TypoScriptParser();
55  $typoScriptParser->parse($typoScript);
56  $res = ['TSconfig' => $typoScriptParser->setup];
57  // The issue only pops up if the TS was cached. This call simulates the unserialize(serialize())
58  // call done by the cache framework to trigger the issue.
59  $res = unserialize(serialize($res));
60  $res['TSconfig']['RTE.']['default.']['FE.']['proc.']['entryHTMLparser_db.']['tags.'] = 'This';
61  self::assertEquals([], $res['TSconfig']['RTE.']['default.']['proc.']['entryHTMLparser_db.']['tags.']);
62  }
63 }
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
Definition: TypoScriptParser.php:36
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\Parser\TypoScriptParserTest
Definition: TypoScriptParserTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\Parser
Definition: TypoScriptParserTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\Parser\TypoScriptParserTest\hasFlakyReferences
‪hasFlakyReferences()
Definition: TypoScriptParserTest.php:35
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\Parser\TypoScriptParserTest\$initializeDatabase
‪bool $initializeDatabase
Definition: TypoScriptParserTest.php:27