FluidTYPO3\Flux\Tests\Unit\Backend\PreviewTest::stopsRenderingWhenProviderSaysStop PHP Method

stopsRenderingWhenProviderSaysStop() public method

    public function stopsRenderingWhenProviderSaysStop()
    {
        $instance = $this->getMock('FluidTYPO3\\Flux\\Backend\\Preview', array('createShortcutIcon', 'attachAssets'));
        $instance->expects($this->never())->method('createShortcutIcon');
        $configurationServiceMock = $this->getMock('FluidTYPO3\\Flux\\Service\\FluxService', array('resolveConfigurationProviders'));
        $providerOne = $this->getMock('FluidTYPO3\\Flux\\Provider\\ContentProvider', array('getPreview'));
        $providerOne->expects($this->once())->method('getPreview')->will($this->returnValue(array('test', 'test', FALSE)));
        $providerTwo = $this->getMock('FluidTYPO3\\Flux\\Provider\\ContentProvider', array('getPreview'));
        $providerTwo->expects($this->never())->method('getPreview');
        $configurationServiceMock->expects($this->once())->method('resolveConfigurationProviders')->will($this->returnValue(array($providerOne, $providerTwo)));
        ObjectAccess::setProperty($instance, 'configurationService', $configurationServiceMock, TRUE);
        $header = 'test';
        $item = 'test';
        $record = Records::$contentRecordIsParentAndHasChildren;
        $draw = TRUE;
        $this->setup();
        $instance->renderPreview($header, $item, $record, $draw);
    }