eZ\Publish\Core\MVC\Symfony\FieldType\Tests\RichText\RendererTest::testRenderLocationEmbedNotFound PHP Метод

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

public testRenderLocationEmbedNotFound ( Exception $exception )
$exception Exception
    public function testRenderLocationEmbedNotFound(Exception $exception)
    {
        $renderer = $this->getMockedRenderer(array('render', 'checkLocation', 'getEmbedTemplateName'));
        $locationId = 42;
        $viewType = 'embedTest';
        $parameters = array('parameters');
        $isInline = true;
        $result = null;
        $renderer->expects($this->once())->method('checkLocation')->with($locationId)->will($this->throwException($exception));
        $renderer->expects($this->never())->method('render');
        $renderer->expects($this->never())->method('getEmbedTemplateName');
        $this->templateEngineMock->expects($this->never())->method('exists');
        $this->loggerMock->expects($this->once())->method('error')->with("Could not render embedded resource: Location #{$locationId} not found");
        $this->assertEquals($result, $renderer->renderLocationEmbed($locationId, $viewType, $parameters, $isInline));
    }