setAuthenticated() public méthode

public setAuthenticated ( $isAuthenticated )
    /**
     * Authenticate a user with Symfony Security
     *
     * @param Boolean $reAuthenticate
     * @return null
     */
    protected function authenticateUser(User $user, $reAuthenticate = false)
    {
        $token = new UsernamePasswordToken($user, null, $user->getRoles());

        if (true === $reAuthenticate) {
            $token->setAuthenticated(false);
        }

        $this->get('security.context')->setToken($token);
    }
 public function testSetAuthenticatedToFalse()
 {
     $token = new UsernamePasswordToken('foo', 'bar');
     $token->setAuthenticated(false);
     $this->assertFalse($token->isAuthenticated());
 }