ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMd5PasswordEncoderTest Class Reference
+ Inheritance diagram for ilMd5PasswordEncoderTest:
+ Collaboration diagram for ilMd5PasswordEncoderTest:

Public Member Functions

 testInstanceCanBeCreated ()
 testPasswordShouldBeCorrectlyEncoded ()
 testPasswordCanBeVerified ()
 testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ()
 ilPasswordException
 testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ()
 testNameShouldBeMd5 ()

Detailed Description

Definition at line 11 of file ilMd5PasswordEncoderTest.php.

Member Function Documentation

ilMd5PasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ( )

ilPasswordException

Definition at line 42 of file ilMd5PasswordEncoderTest.php.

{
$encoder = new ilMd5PasswordEncoder();
$encoder->encodePassword(str_repeat('a', 5000), '');
}
ilMd5PasswordEncoderTest::testInstanceCanBeCreated ( )

Definition at line 16 of file ilMd5PasswordEncoderTest.php.

{
$this->assertInstanceOf('ilMd5PasswordEncoder', new ilMd5PasswordEncoder());
}
ilMd5PasswordEncoderTest::testNameShouldBeMd5 ( )

Definition at line 60 of file ilMd5PasswordEncoderTest.php.

{
$encoder = new ilMd5PasswordEncoder();
$this->assertEquals('md5', $encoder->getName());
}
ilMd5PasswordEncoderTest::testPasswordCanBeVerified ( )

Definition at line 33 of file ilMd5PasswordEncoderTest.php.

{
$encoder = new ilMd5PasswordEncoder();
$this->assertTrue($encoder->isPasswordValid(md5('password'), 'password', ''));
}
ilMd5PasswordEncoderTest::testPasswordShouldBeCorrectlyEncoded ( )
Exceptions
ilPasswordException

Definition at line 24 of file ilMd5PasswordEncoderTest.php.

{
$encoder = new ilMd5PasswordEncoder();
$this->assertSame(md5('password'), $encoder->encodePassword('password', ''));
}
ilMd5PasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( )

Definition at line 51 of file ilMd5PasswordEncoderTest.php.

{
$encoder = new ilMd5PasswordEncoder();
$this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), ''));
}

The documentation for this class was generated from the following file: