/**
* @dataProvider getPostProcessBackendLayoutTestValues
* @param Provider $provider
* @param mixed $record
* @param string $messageFunction
* @param integer $messageCount
* @param array $expected
*/
public function testPostProcessBackendLayout(Provider $provider, $record, $messageFunction, $messageCount, array $expected)
{
$GLOBALS['LANG'] = $this->getMock('TYPO3\\CMS\\Lang\\LanguageService', array('sL'));
$GLOBALS['LANG']->expects($this->any())->method('sL')->willReturn('translatedlabel');
$instance = new BackendLayout();
$pageUid = 1;
$backendLayout = array();
$configurationService = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\ConfigurationService', array('resolvePrimaryConfigurationProvider', 'debug', 'message'));
$configurationService->expects($this->exactly($messageCount))->method($messageFunction);
if (NULL !== $record) {
$configurationService->expects($this->once())->method('resolvePrimaryConfigurationProvider')->with('pages', 'tx_fed_page_flexform', $record)->willReturn($provider);
}
$recordService = $this->getMock('FluidTYPO3\\Flux\\Service\\WorkspacesAwareRecordService', array('getSingle'));
$recordService->expects($this->once())->method('getSingle')->willReturn($record);
$instance->injectConfigurationService($configurationService);
$instance->injectWorkspacesAwareRecordService($recordService);
$instance->postProcessBackendLayout($pageUid, $backendLayout);
$this->assertEquals($expected, $backendLayout);
}