JeremyKendall\Password\Tests\Decorator\KarptoniteRehashUpgradeDecoratorTest::testRehashingPasswordHashesScenarioCredentialIsNotValid PHP Метод

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

    public function testRehashingPasswordHashesScenarioCredentialIsNotValid()
    {
        $wrongPlainTextPassword = 'i-forgot-my-password';
        $invalidResult = new ValidationResult(ValidationResult::FAILURE_PASSWORD_INVALID);
        $this->decoratedValidator->expects($this->never())->method('rehash');
        $this->decoratedValidator->expects($this->once())->method('isValid')->with($wrongPlainTextPassword, $this->upgradedLegacyHash, $this->legacySalt)->will($this->returnValue($invalidResult));
        $result = $this->decorator->isValid($wrongPlainTextPassword, $this->upgradedLegacyHash, $this->legacySalt);
        $this->assertFalse($result->isValid());
        $this->assertEquals(ValidationResult::FAILURE_PASSWORD_INVALID, $result->getCode());
    }