/** * @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\Content\Configured::getView */ public function testGetViewContent() { $template = 'my_template.html.twig'; $configHash = array('match' => array(), 'template' => $template); $this->matcherFactoryMock->expects($this->once())->method('match')->will($this->returnValue($configHash)); $cvp = new ContentViewProvider($this->matcherFactoryMock); $view = $cvp->getView($this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo'), '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()); }
/** * Returns the matcher object either from a service identifier or from a class. * * @param string $matcherIdentifier If it is a service identifier, the matcher will be built with the service container. * * @return \eZ\Publish\Core\MVC\Symfony\View\ContentViewProvider\Configured\Matcher */ protected function getMatcher($matcherIdentifier) { if ($this->container->has($matcherIdentifier)) { return $this->container->get($matcherIdentifier); } return parent::getMatcher($matcherIdentifier); }