/**
* @test
* @dataProvider positionalSubElements
*
* @param string $message
* @param array $subElements
* @param array $expectedKeyOrder
*/
public function evaluateRendersKeysSortedByPositionMetaProperty($message, $subElements, $expectedKeyOrder)
{
$mockTsRuntime = $this->getMockBuilder(Runtime::class)->disableOriginalConstructor()->getMock();
$mockTsRuntime->expects($this->any())->method('evaluate')->will($this->returnCallback(function ($path) use(&$renderedPaths) {
$renderedPaths[] = $path;
}));
$path = '';
$typoScriptObjectName = 'Neos.Fusion:Array';
$renderer = new ArrayImplementation($mockTsRuntime, $path, $typoScriptObjectName);
foreach ($subElements as $key => $value) {
$renderer[$key] = $value;
}
$renderer->evaluate();
$this->assertSame($expectedKeyOrder, $renderedPaths, $message);
}