ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilMd5PasswordEncoderTest Class Reference
+ Inheritance diagram for ilMd5PasswordEncoderTest:
+ Collaboration diagram for ilMd5PasswordEncoderTest:

Public Member Functions

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

Detailed Description

Definition at line 23 of file ilMd5PasswordEncoderTest.php.

Member Function Documentation

◆ testEncoderDoesNotRelyOnSalts()

ilMd5PasswordEncoderTest::testEncoderDoesNotRelyOnSalts ( ilMd5PasswordEncoder  $encoder)

Definition at line 45 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresSalt().

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

◆ testEncoderDoesNotSupportReencoding()

ilMd5PasswordEncoderTest::testEncoderDoesNotSupportReencoding ( ilMd5PasswordEncoder  $encoder)

Definition at line 51 of file ilMd5PasswordEncoderTest.php.

References ilBasePasswordEncoder\requiresReencoding().

51  : void
52  {
53  $this->assertFalse($encoder->requiresReencoding('hello'));
54  }
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)

Definition at line 57 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\encodePassword().

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

◆ testInstanceCanBeCreated()

ilMd5PasswordEncoderTest::testInstanceCanBeCreated ( )

Definition at line 25 of file ilMd5PasswordEncoderTest.php.

26  {
27  $encoder = new ilMd5PasswordEncoder();
28  $this->assertInstanceOf(ilMd5PasswordEncoder::class, $encoder);
29  return $encoder;
30  }

◆ testNameShouldBeMd5()

ilMd5PasswordEncoderTest::testNameShouldBeMd5 ( ilMd5PasswordEncoder  $encoder)

Definition at line 72 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\getName().

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

◆ testPasswordCanBeVerified()

ilMd5PasswordEncoderTest::testPasswordCanBeVerified ( ilMd5PasswordEncoder  $encoder)

Definition at line 39 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

39  : void
40  {
41  $this->assertTrue($encoder->isPasswordValid(md5('password'), 'password', ''));
42  }
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)

Definition at line 33 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\encodePassword().

33  : void
34  {
35  $this->assertSame(md5('password'), $encoder->encodePassword('password', ''));
36  }
encodePassword(string $raw, string $salt)
Encodes the raw password.
+ Here is the call graph for this function:

◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()

ilMd5PasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( ilMd5PasswordEncoder  $encoder)

Definition at line 65 of file ilMd5PasswordEncoderTest.php.

References ilMd5PasswordEncoder\isPasswordValid().

67  : void {
68  $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), ''));
69  }
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: