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

testRenderLocationEmbedInvisible() public method

    public function testRenderLocationEmbedInvisible()
    {
        $renderer = $this->getMockedRenderer(array('render', 'checkLocation', 'getEmbedTemplateName'));
        $locationId = 42;
        $viewType = 'embedTest';
        $parameters = array('parameters');
        $isInline = true;
        $mockLocation = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Location');
        $mockLocation->expects($this->once())->method('__get')->with('invisible')->will($this->returnValue(true));
        $renderer->expects($this->once())->method('checkLocation')->with($locationId)->will($this->returnValue($mockLocation));
        $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} is not visible");
        $this->assertEquals(null, $renderer->renderLocationEmbed($locationId, $viewType, $parameters, $isInline));
    }