Shortcut to return the Doctrine Registry service.
protected getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry | ||
Résultat | Doctrine\Bundle\DoctrineBundle\Registry |
public function testGetDoctrine() { $doctrine = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry'); $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); $container->expects($this->at(0))->method('has')->will($this->returnValue(true)); $container->expects($this->at(1))->method('get')->will($this->returnValue($doctrine)); $controller = new Controller(); $controller->setContainer($container); $this->assertEquals($doctrine, $controller->getDoctrine()); }
public function getDoctrine() { return parent::getDoctrine(); }