/** * @test */ public function parserCorrectlyParsesFixture17() { $fixture = __DIR__ . '/Fixtures/ParserTestTypoScriptFixture17.ts2'; $sourceCode = file_get_contents($fixture, FILE_TEXT); $expectedParseTree = $this->getExpectedParseTreeForFixture16(); // Check that values were overridden by fixture #17: $expectedParseTree['__prototypes']['TYPO3.Foo:Bar2']['baz'] = 'New Value'; // Set the default namespace to TYPO3.Neos - that's what Neos does as well in Domain\Service\TypoScriptService: $this->parser->setObjectTypeNamespace('default', 'TYPO3.Neos'); $text = array('__objectType' => 'TYPO3.Neos:Text', '__value' => null, '__eelExpression' => null); // Make sure that the namespace declaration for "default" is also available when fixture #17b is parsed: $expectedParseTree['object'] = $text; // Test normal globbing $expectedParseTree['globbing1'] = $text; $expectedParseTree['globbing2'] = $text; // Test recursive globbing $expectedParseTree['recursiveGlobbing1'] = $text; $expectedParseTree['recursiveGlobbing2'] = $text; $expectedParseTree['recursiveGlobbingUpTheTree'] = $text; // Test globbing with dots $expectedParseTree['globbingWithDots1'] = $text; $actualParseTree = $this->parser->parse($sourceCode, $fixture); $this->assertEquals($expectedParseTree, $actualParseTree, 'The parse tree was not as expected after parsing fixture 17'); }
/** * Initializes the parser * * @return void */ public function initializeObject() { $this->typoScriptParser->setObjectTypeNamespace('default', 'TYPO3.Neos'); }