FluidTYPO3\Fluidpages\Tests\Unit\Backend\BackendLayoutTest::testPostProcessBackendLayout PHP Method

testPostProcessBackendLayout() public method

public testPostProcessBackendLayout ( FluidTYPO3\Flux\Provider\Provider $provider, mixed $record, string $messageFunction, integer $messageCount, array $expected )
$provider FluidTYPO3\Flux\Provider\Provider
$record mixed
$messageFunction string
$messageCount integer
$expected array
    public function testPostProcessBackendLayout(Provider $provider, $record, $messageFunction, $messageCount, array $expected)
    {
        $instance = new BackendLayout();
        $pageUid = 1;
        $backendLayout = array();
        /** @var ConfigurationService|\PHPUnit_Framework_MockObject_MockObject $configurationService */
        $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);
        }
        /** @var WorkspacesAwareRecordService|\PHPUnit_Framework_MockObject_MockObject $recordService */
        $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);
    }