PopTest\Auth\AuthTest::testSetAttemptLimit PHP Method

testSetAttemptLimit() public method

public testSetAttemptLimit ( )
    public function testSetAttemptLimit()
    {
        $a = new Auth(new File(__DIR__ . '/../tmp/access.txt'));
        $a->setAttempts(5);
        $a->setAttemptLimit(3);
        $a->authenticate('testuser1', '12test34');
        $this->assertEquals(Auth::ATTEMPTS_EXCEEDED, $a->getResult());
        $this->assertEquals('The allowed login attempts (3) have been exceeded.', $a->getResultMessage());
        $this->assertEquals(6, $a->getAttempts());
        $this->assertEquals(3, $a->getValidator('attempts')->getValue());
        $a->setAttemptLimit();
        $this->assertEquals(null, $a->getValidator('attempts'));
    }