/**
* @test
* @dataProvider tagExamples
*/
public function evaluateTests($properties, $attributes, $content, $expectedOutput)
{
$path = 'tag/test';
$this->mockTsRuntime->expects($this->any())->method('evaluate')->will($this->returnCallback(function ($evaluatePath, $that) use($properties, $path, $attributes, $content) {
$relativePath = str_replace($path . '/', '', $evaluatePath);
switch ($relativePath) {
case 'attributes':
return $attributes;
case 'content':
return $content;
}
return isset($properties[$relativePath]) ? $properties[$relativePath] : null;
}));
$typoScriptObjectName = 'Neos.Fusion:Tag';
$renderer = new TagImplementation($this->mockTsRuntime, $path, $typoScriptObjectName);
$result = $renderer->evaluate();
$this->assertEquals($expectedOutput, $result);
}