Neos\Flow\Security\Authentication\Provider\TestingProvider::reset PHP Method

reset() public method

Reset the authentication status and account
public reset ( ) : void
return void
    public function reset()
    {
        $this->account = null;
        $this->authenticationStatus = TokenInterface::NO_CREDENTIALS_GIVEN;
    }

Usage Example

 /**
  * Resets security test requirements
  *
  * @return void
  */
 protected function tearDownSecurity()
 {
     if ($this->privilegeManager !== null) {
         $this->privilegeManager->reset();
     }
     if ($this->policyService !== null) {
         $this->policyService->reset();
     }
     if ($this->testingProvider !== null) {
         $this->testingProvider->reset();
     }
     if ($this->securityContext !== null) {
         $this->securityContext->clearContext();
     }
     if ($this->authenticationManager !== null) {
         \Neos\Utility\ObjectAccess::setProperty($this->authenticationManager, 'isAuthenticated', null, true);
     }
 }