ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilMd5PasswordEncoderTest Class Reference
+ Inheritance diagram for ilMd5PasswordEncoderTest:
+ Collaboration diagram for ilMd5PasswordEncoderTest:

Public Member Functions

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

Detailed Description

Definition at line 11 of file ilMd5PasswordEncoderTest.php.

Member Function Documentation

◆ testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding()

ilMd5PasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ( )

ilPasswordException

Definition at line 42 of file ilMd5PasswordEncoderTest.php.

43  {
44  $encoder = new ilMd5PasswordEncoder();
45  $encoder->encodePassword(str_repeat('a', 5000), '');
46  }

◆ testInstanceCanBeCreated()

ilMd5PasswordEncoderTest::testInstanceCanBeCreated ( )

Definition at line 16 of file ilMd5PasswordEncoderTest.php.

17  {
18  $this->assertInstanceOf('ilMd5PasswordEncoder', new ilMd5PasswordEncoder());
19  }

◆ testNameShouldBeMd5()

ilMd5PasswordEncoderTest::testNameShouldBeMd5 ( )

Definition at line 60 of file ilMd5PasswordEncoderTest.php.

61  {
62  $encoder = new ilMd5PasswordEncoder();
63  $this->assertEquals('md5', $encoder->getName());
64  }

◆ testPasswordCanBeVerified()

ilMd5PasswordEncoderTest::testPasswordCanBeVerified ( )

Definition at line 33 of file ilMd5PasswordEncoderTest.php.

34  {
35  $encoder = new ilMd5PasswordEncoder();
36  $this->assertTrue($encoder->isPasswordValid(md5('password'), 'password', ''));
37  }

◆ testPasswordShouldBeCorrectlyEncoded()

ilMd5PasswordEncoderTest::testPasswordShouldBeCorrectlyEncoded ( )
Exceptions
ilPasswordException

Definition at line 24 of file ilMd5PasswordEncoderTest.php.

25  {
26  $encoder = new ilMd5PasswordEncoder();
27  $this->assertSame(md5('password'), $encoder->encodePassword('password', ''));
28  }

◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()

ilMd5PasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( )

Definition at line 51 of file ilMd5PasswordEncoderTest.php.

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

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