removed isAuthenticated() from SecurityContext

This commit is contained in:
Johannes Schmitt 2011-01-26 00:51:38 +01:00 committed by Fabien Potencier
parent 57ae50e894
commit e0fe42d050
2 changed files with 0 additions and 22 deletions

View File

@ -72,11 +72,6 @@ class SecurityContext
return $this->accessDecisionManager->decide($this->token, (array) $attributes, $object);
}
public function isAuthenticated()
{
return null === $this->token ? false : $this->token->isAuthenticated();
}
/**
* Gets the currently authenticated token.
*

View File

@ -16,23 +16,6 @@ use Symfony\Component\Security\SecurityContext;
class SecurityContextTest extends \PHPUnit_Framework_TestCase
{
public function testIsAuthenticated()
{
$context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'));
$this->assertFalse($context->isAuthenticated());
$token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
$token->expects($this->once())->method('isAuthenticated')->will($this->returnValue(false));
$context->setToken($token);
$this->assertFalse($context->isAuthenticated());
$token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface');
$token->expects($this->once())->method('isAuthenticated')->will($this->returnValue(true));
$context->setToken($token);
$this->assertTrue($context->isAuthenticated());
}
public function testGetUser()
{
$context = new SecurityContext($this->getMock('Symfony\Component\Security\Authentication\AuthenticationManagerInterface'));