FluidTYPO3\Fluidpages\Tests\Unit\Backend\BackendLayoutDataProviderTest::testGetBackendLayoutConfiguration PHP Метод

testGetBackendLayoutConfiguration() публичный Метод

public testGetBackendLayoutConfiguration ( FluidTYPO3\Flux\Provider\Provider $provider, mixed $record, array $expected )
$provider FluidTYPO3\Flux\Provider\Provider
$record mixed
$expected array
    public function testGetBackendLayoutConfiguration(Provider $provider, $record, array $expected)
    {
        $instance = new BackendLayoutDataProvider();
        $pageUid = 1;
        /** @var ConfigurationService|\PHPUnit_Framework_MockObject_MockObject $configurationService */
        $configurationService = $this->getMock('FluidTYPO3\\Fluidpages\\Service\\ConfigurationService', array('resolvePageProvider', 'debug', 'message'));
        if (null !== $record) {
            $configurationService->expects($this->once())->method('resolvePageProvider')->with($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);
        $result = $this->callInaccessibleMethod($instance, 'getBackendLayoutConfiguration', $pageUid);
        $this->assertEquals($expected, $result);
    }