Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::getDoctrine PHP Method

getDoctrine() public method

public getDoctrine ( )
    public function getDoctrine()
    {
        return parent::getDoctrine();
    }

Usage Example

Example #1
0
 public function testGetDoctrine()
 {
     $doctrine = $this->getMockBuilder('Doctrine\\Common\\Persistence\\ManagerRegistry')->getMock();
     $container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerInterface')->getMock();
     $container->expects($this->at(0))->method('has')->will($this->returnValue(true));
     $container->expects($this->at(1))->method('get')->will($this->returnValue($doctrine));
     $controller = new TestController();
     $controller->setContainer($container);
     $this->assertEquals($doctrine, $controller->getDoctrine());
 }