public function getUser()
{
return parent::getUser();
}
/** * @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(); }