ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 More...
 
 testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testNameShouldBeMd5 (ilMd5PasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 

Detailed Description

Definition at line 26 of file ilMd5PasswordEncoderTest.php.

Member Function Documentation

◆ testEncoderDoesNotRelyOnSalts()

ilMd5PasswordEncoderTest::testEncoderDoesNotRelyOnSalts ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 56 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresSalt().

56  : void
57  {
58  $this->assertFalse($encoder->requiresSalt());
59  }
requiresSalt()
Returns whether the encoder requires a salt.
+ Here is the call graph for this function:

◆ testEncoderDoesNotSupportReencoding()

ilMd5PasswordEncoderTest::testEncoderDoesNotSupportReencoding ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 64 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresReencoding().

64  : void
65  {
66  $this->assertFalse($encoder->requiresReencoding('hello'));
67  }
requiresReencoding(string $encoded)
Returns whether the encoded password needs to be re-encoded.
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding()

ilMd5PasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Exceptions
ilPasswordException

Definition at line 73 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\encodePassword().

75  : void {
76  $this->expectException(ilPasswordException::class);
77  $encoder->encodePassword(str_repeat('a', 5000), '');
78  }
encodePassword(string $raw, string $salt)
Encodes the raw password.
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilMd5PasswordEncoderTest::testInstanceCanBeCreated ( )

Definition at line 28 of file ilMd5PasswordEncoderTest.php.

29  {
30  $encoder = new ilMd5PasswordEncoder();
31  $this->assertInstanceOf(ilMd5PasswordEncoder::class, $encoder);
32  return $encoder;
33  }

◆ testNameShouldBeMd5()

ilMd5PasswordEncoderTest::testNameShouldBeMd5 ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Definition at line 93 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\getName().

93  : void
94  {
95  $this->assertSame('md5', $encoder->getName());
96  }
getName()
Returns a unique name/id of the concrete password encoder.
+ Here is the call graph for this function:

◆ testPasswordCanBeVerified()

ilMd5PasswordEncoderTest::testPasswordCanBeVerified ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Exceptions
ilPasswordException

Definition at line 48 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

48  : void
49  {
50  $this->assertTrue($encoder->isPasswordValid(md5('password'), 'password', ''));
51  }
isPasswordValid(string $encoded, string $raw, string $salt)
Checks a raw password against an encoded password.
+ Here is the call graph for this function:

◆ testPasswordShouldBeCorrectlyEncoded()

ilMd5PasswordEncoderTest::testPasswordShouldBeCorrectlyEncoded ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Exceptions
ilPasswordException

Definition at line 39 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\encodePassword().

39  : void
40  {
41  $this->assertSame(md5('password'), $encoder->encodePassword('password', ''));
42  }
encodePassword(string $raw, string $salt)
Encodes the raw password.
+ Here is the call graph for this function:

◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()

ilMd5PasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( ilMd5PasswordEncoder  $encoder)

testInstanceCanBeCreated

Exceptions
ilPasswordException

Definition at line 84 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

86  : void {
87  $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), ''));
88  }
isPasswordValid(string $encoded, string $raw, string $salt)
Checks a raw password against an encoded password.
+ Here is the call graph for this function:

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