/**
* @dataProvider getRenderOptionTestValues
* @param string $file
* @param Form|NULL $form
* @param $expectedMessageFunction
* @param $expectsEmptyOutput
*/
public function testRenderOption($file, $form, $expectedMessageFunction, $expectsEmptyOutput)
{
$instance = new PageLayoutSelector();
/** @var ConfigurationService|\PHPUnit_Framework_MockObject_MockObject $service */
$service = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\ConfigurationService', array('getPageConfiguration', 'getFormFromTemplateFile', 'message', 'debug'));
$service->expects($this->any())->method('getPageConfiguration')->willReturn(array('templateRootPaths' => array('EXT:fluidpages/Tests/Fixtures/Templates/')));
$service->expects($this->any())->method('getFormFromTemplateFile')->willReturn($form);
if (NULL !== $expectedMessageFunction) {
$service->expects($this->once())->method($expectedMessageFunction);
}
$instance->injectConfigurationService($service);
$result = $this->callInaccessibleMethod($instance, 'renderOption', 'fluidpages', $file, array());
if (TRUE === $expectsEmptyOutput) {
$this->assertEmpty($result);
} else {
$this->assertNotEmpty($result);
}
}