4require_once
'Services/Password/classes/encoders/class.ilMd5PasswordEncoder.php';
5require_once
'Services/Password/test/ilPasswordBaseTest.php';
20 $this->assertInstanceOf(
'ilMd5PasswordEncoder', $encoder);
29 $this->assertSame(md5(
'password'), $encoder->
encodePassword(
'password',
''));
37 $this->assertTrue($encoder->
isPasswordValid(md5(
'password'),
'password',
''));
71 $this->assertFalse($encoder->
isPasswordValid(
'encoded', str_repeat(
'a', 5000),
''));
79 $this->assertEquals(
'md5', $encoder->
getName());
An exception for terminatinating execution or to throw for unit testing.
requiresSalt()
{Returns whether or not the encoder requires a salt.boolean}
requiresReencoding($encoded)
{Returns whether or not the a encoded password needs to be re-encoded.boolean}
testEncoderDoesNotSupportReencoding(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testPasswordCanBeVerified(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated @expectedException ilPasswordException
testNameShouldBeMd5(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testPasswordShouldBeCorrectlyEncoded(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testEncoderDoesNotRelyOnSalts(ilMd5PasswordEncoder $encoder)
@depends testInstanceCanBeCreated
testInstanceCanBeCreated()
isPasswordValid($encoded, $raw, $salt)
{Checks a raw password against an encoded password.The raw password has to be injected into the encod...
encodePassword($raw, $salt)
{Encodes the raw password.string The encoded password}
getName()
{Returns a unique name/id of the concrete password encoder.string}
assertException($exception_class)