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

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

public testRenderContentEmbedNotFound ( Exception $exception )
$exception Exception
    public function testRenderContentEmbedNotFound(Exception $exception)
    {
        $renderer = $this->getMockedRenderer(array('render', 'checkContent', 'getEmbedTemplateName'));
        $contentId = 42;
        $viewType = 'embedTest';
        $parameters = array('parameters');
        $isInline = true;
        $result = null;
        $renderer->expects($this->once())->method('checkContent')->with($contentId)->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: Content #{$contentId} not found");
        $this->assertEquals($result, $renderer->renderContentEmbed($contentId, $viewType, $parameters, $isInline));
    }