Neos\Flow\Tests\Functional\Security\Authentication\Provider\PersistedUsernamePasswordProviderTest::authenticationWithCorrectCredentialsResetsFailedAuthenticationCount PHP Метод

authenticationWithCorrectCredentialsResetsFailedAuthenticationCount() публичный Метод

    public function authenticationWithCorrectCredentialsResetsFailedAuthenticationCount()
    {
        $this->authenticationToken->_set('credentials', ['username' => 'username', 'password' => 'wrongPW']);
        $this->persistedUsernamePasswordProvider->authenticate($this->authenticationToken);
        $account = $this->accountRepository->findActiveByAccountIdentifierAndAuthenticationProviderName('username', 'myTestProvider');
        $this->assertEquals(1, $account->getFailedAuthenticationCount());
        $this->authenticationToken->_set('credentials', ['username' => 'username', 'password' => 'password']);
        $this->persistedUsernamePasswordProvider->authenticate($this->authenticationToken);
        $account = $this->accountRepository->findActiveByAccountIdentifierAndAuthenticationProviderName('username', 'myTestProvider');
        $this->assertEquals(new \DateTime(), $account->getLastSuccessfulAuthenticationDate());
        $this->assertEquals(0, $account->getFailedAuthenticationCount());
    }