19 declare(strict_types=1);
31 $this->assertInstanceOf(ilMd5PasswordEncoder::class, $encoder);
41 $this->assertSame(md5(
'password'), $encoder->
encodePassword(
'password',
''));
50 $this->assertTrue($encoder->
isPasswordValid(md5(
'password'),
'password',
''));
76 $this->expectException(ilPasswordException::class);
87 $this->assertFalse($encoder->
isPasswordValid(
'encoded', str_repeat(
'a', 5000),
''));
95 $this->assertSame(
'md5', $encoder->
getName());
testNameShouldBeMd5(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
testInstanceCanBeCreated()
requiresSalt()
Returns whether the encoder requires a salt.
testEncoderDoesNotRelyOnSalts(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
requiresReencoding(string $encoded)
Returns whether the encoded password needs to be re-encoded.
testEncoderDoesNotSupportReencoding(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
encodePassword(string $raw, string $salt)
Encodes the raw password.
getName()
Returns a unique name/id of the concrete password encoder.
testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
testPasswordCanBeVerified(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
testPasswordShouldBeCorrectlyEncoded(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(ilMd5PasswordEncoder $encoder)
testInstanceCanBeCreated
isPasswordValid(string $encoded, string $raw, string $salt)
Checks a raw password against an encoded password.