getDoctrine() protected method

Shortcut to return the Doctrine Registry service.
protected getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry
return 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());
 }
Example #2
0
 public function getDoctrine()
 {
     return parent::getDoctrine();
 }