ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMd5PasswordEncoderTest Class Reference
+ Inheritance diagram for ilMd5PasswordEncoderTest:
+ Collaboration diagram for ilMd5PasswordEncoderTest:

Public Member Functions

 testInstanceCanBeCreated ()
 
 testPasswordShouldBeCorrectlyEncoded (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testPasswordCanBeVerified (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testEncoderDoesNotRelyOnSalts (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testEncoderDoesNotSupportReencoding (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated ilPasswordException More...
 
 testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testNameShouldBeMd5 (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilPasswordBaseTest
 assertException ($exception_class)
 

Detailed Description

Definition at line 12 of file ilMd5PasswordEncoderTest.php.

Member Function Documentation

◆ testEncoderDoesNotRelyOnSalts()

ilMd5PasswordEncoderTest::testEncoderDoesNotRelyOnSalts ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 43 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresSalt().

44  {
45  $this->assertFalse($encoder->requiresSalt());
46  }
requiresSalt()
{Returns whether or not the encoder requires a salt.boolean}
+ Here is the call graph for this function:

◆ testEncoderDoesNotSupportReencoding()

ilMd5PasswordEncoderTest::testEncoderDoesNotSupportReencoding ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 51 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresReencoding().

52  {
53  $this->assertFalse($encoder->requiresReencoding('hello'));
54  }
requiresReencoding($encoded)
{Returns whether or not the a encoded password needs to be re-encoded.string boolean} ...
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding()

ilMd5PasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated ilPasswordException

Definition at line 60 of file ilMd5PasswordEncoderTest.php.

References ilPasswordBaseTest\assertException(), and ilMd5PasswordEncoder\encodePassword().

61  {
62  $this->assertException(ilPasswordException::class);
63  $encoder->encodePassword(str_repeat('a', 5000), '');
64  }
encodePassword($raw, $salt)
{Encodes the raw password.The password to encode The salt string The encoded password} ...
assertException($exception_class)
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilMd5PasswordEncoderTest::testInstanceCanBeCreated ( )
Returns
ilMd5PasswordEncoder

Definition at line 17 of file ilMd5PasswordEncoderTest.php.

18  {
19  $encoder = new ilMd5PasswordEncoder();
20  $this->assertInstanceOf('ilMd5PasswordEncoder', $encoder);
21  return $encoder;
22  }

◆ testNameShouldBeMd5()

ilMd5PasswordEncoderTest::testNameShouldBeMd5 ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 77 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\getName().

78  {
79  $this->assertEquals('md5', $encoder->getName());
80  }
getName()
{Returns a unique name/id of the concrete password encoder.string}
+ Here is the call graph for this function:

◆ testPasswordCanBeVerified()

ilMd5PasswordEncoderTest::testPasswordCanBeVerified ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 35 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

36  {
37  $this->assertTrue($encoder->isPasswordValid(md5('password'), 'password', ''));
38  }
isPasswordValid($encoded, $raw, $salt)
{Checks a raw password against an encoded password.The raw password has to be injected into the encod...
+ Here is the call graph for this function:

◆ testPasswordShouldBeCorrectlyEncoded()

ilMd5PasswordEncoderTest::testPasswordShouldBeCorrectlyEncoded ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 27 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\encodePassword().

28  {
29  $this->assertSame(md5('password'), $encoder->encodePassword('password', ''));
30  }
encodePassword($raw, $salt)
{Encodes the raw password.The password to encode The salt string The encoded password} ...
+ Here is the call graph for this function:

◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()

ilMd5PasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 69 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

70  {
71  $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), ''));
72  }
isPasswordValid($encoded, $raw, $salt)
{Checks a raw password against an encoded password.The raw password has to be injected into the encod...
+ Here is the call graph for this function:

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