public function testGetUser($user, $expectedUser)
{
$tokenStorage = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface')->getMock();
$token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')->getMock();
$this->container->set('security.token_storage', $tokenStorage);
$token->expects($this->once())->method('getUser')->will($this->returnValue($user));
$tokenStorage->expects($this->once())->method('getToken')->will($this->returnValue($token));
$this->assertSame($expectedUser, $this->globals->getUser());
}