/** * @covers \eZ\Publish\Core\MVC\Symfony\View\Provider\Configured::__construct * @covers \eZ\Publish\Core\MVC\Symfony\View\Provider\Configured::buildContentView * @covers \eZ\Publish\Core\MVC\Symfony\View\Provider\Location\Configured::getView */ public function testGetViewLocation() { $template = 'my_template.html.twig'; $configHash = array('match' => array(), 'template' => $template); $this->matcherFactoryMock->expects($this->once())->method('match')->will($this->returnValue($configHash)); $lvp = new LocationViewProvider($this->matcherFactoryMock); $view = $lvp->getView($this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Location'), 'full'); $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\View\\ContentView', $view); $this->assertSame($configHash, $view->getConfigHash()); $this->assertSame($template, $view->getTemplateIdentifier()); $this->assertSame(array(), $view->getParameters()); }
/** * @expectedException \InvalidArgumentException * * @covers \eZ\Publish\Core\MVC\Symfony\View\Provider\Content\Configured::__construct * @covers \eZ\Publish\Core\MVC\Symfony\View\Provider\Content\Configured::getView */ public function testGetViewLocationWrongMatcher() { $lvp = new LocationViewProvider($this->getRepositoryMock(), array('full' => array('failingMatchBlock' => array('match' => array('wrongMatcher' => 'bibou est un gentil garçon'), 'template' => "mytemplate")))); $lvp->getView($this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Location'), 'full'); }