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

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

    public function testRenderLocationEmbedNoTemplateConfigured()
    {
        $renderer = $this->getMockedRenderer(array('render', 'checkLocation', 'getEmbedTemplateName'));
        $locationId = 42;
        $viewType = 'embedTest';
        $templateName = null;
        $parameters = array('parameters');
        $isInline = true;
        $isDenied = false;
        $mockLocation = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Location');
        $mockLocation->expects($this->once())->method('__get')->with('invisible')->will($this->returnValue(false));
        $renderer->expects($this->once())->method('checkLocation')->with($locationId)->will($this->returnValue($mockLocation));
        $renderer->expects($this->never())->method('render');
        $renderer->expects($this->once())->method('getEmbedTemplateName')->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied)->will($this->returnValue($templateName));
        $this->templateEngineMock->expects($this->never())->method('exists');
        $this->loggerMock->expects($this->once())->method('error')->with('Could not render embedded resource: no template configured');
        $this->assertEquals(null, $renderer->renderLocationEmbed($locationId, $viewType, $parameters, $isInline));
    }