public function testRenderLocationEmbedNoTemplateFound()
{
$renderer = $this->getMockedRenderer(array('render', 'checkLocation', 'getEmbedTemplateName'));
$locationId = 42;
$viewType = 'embedTest';
$templateName = 'templateName';
$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->once())->method('exists')->with($templateName)->will($this->returnValue(false));
$this->loggerMock->expects($this->once())->method('error')->with("Could not render embedded resource: template '{$templateName}' does not exists");
$this->assertEquals(null, $renderer->renderLocationEmbed($locationId, $viewType, $parameters, $isInline));
}