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

getUser() public method

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

Usage Example

Ejemplo n.º 1
0
 /**
  * @expectedException \LogicException
  * @expectedExceptionMessage The SecurityBundle is not registered in your application.
  */
 public function testGetUserWithEmptyContainer()
 {
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $container->expects($this->once())->method('has')->with('security.token_storage')->will($this->returnValue(false));
     $controller = new TestController();
     $controller->setContainer($container);
     $controller->getUser();
 }