Bladeren bron

removed isAuthenticated() from SecurityContext

Johannes Schmitt 14 jaren geleden
bovenliggende
commit
e0fe42d050

+ 0 - 5
src/Symfony/Component/Security/SecurityContext.php

@@ -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.
      *

+ 0 - 17
tests/Symfony/Tests/Component/Security/SecurityContextTest.php

@@ -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'));