eZ\Publish\Core\MVC\Symfony\FieldType\Tests\RichText\RendererTest::testRenderLocationEmbed PHP Method

testRenderLocationEmbed() public method

    public function testRenderLocationEmbed()
    {
        $renderer = $this->getMockedRenderer(array('render', 'checkLocation', 'getEmbedTemplateName'));
        $locationId = 42;
        $viewType = 'embedTest';
        $templateName = 'templateName';
        $parameters = array('parameters');
        $isInline = true;
        $isDenied = false;
        $result = 'result';
        $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->once())->method('render')->with($templateName, $parameters)->will($this->returnValue($result));
        $renderer->expects($this->once())->method('getEmbedTemplateName')->with(Renderer::RESOURCE_TYPE_LOCATION, $isInline, $isDenied)->will($this->returnValue($templateName));
        $this->templateEngineMock->expects($this->once())->method('exists')->with($templateName)->will($this->returnValue(true));
        $this->loggerMock->expects($this->never())->method($this->anything());
        $this->assertEquals($result, $renderer->renderLocationEmbed($locationId, $viewType, $parameters, $isInline));
    }