◆ costsProvider()
ilBcryptPhpPasswordEncoderTest::costsProvider |
( |
| ) |
|
◆ skipIfPhpVersionIsNotSupported()
ilBcryptPhpPasswordEncoderTest::skipIfPhpVersionIsNotSupported |
( |
| ) |
|
|
private |
◆ testCostsCanBeDeterminedDynamically()
@depends testInstanceCanBeCreated
- Parameters
-
- Exceptions
-
Definition at line 168 of file ilBcryptPhpPasswordEncoderTest.php.
168 : void
169 {
172
173 $this->assertTrue($costs_default > 4 && $costs_default < 32);
174 $this->assertTrue($costs_target > 4 && $costs_target < 32);
175 $this->assertIsInt($costs_default);
176 $this->assertIsInt($costs_target);
177 $this->assertNotEquals($costs_default, $costs_target);
178 }
benchmarkCost(float $time_target=0.05)
References ilBcryptPhpPasswordEncoder\benchmarkCost().
◆ testCostsCanBeRetrievedWhenCostsAreSet()
◆ testCostsCanBeSetInRange()
◆ testCostsCannotBeSetAboveRange()
◆ testCostsCannotBeSetBelowRange()
◆ testEncoderDoesNotRelyOnSalts()
◆ testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding()
ilBcryptPhpPasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding |
( |
ilBcryptPhpPasswordEncoder |
$encoder | ) |
|
@depends testInstanceCanBeCreated
- Parameters
-
- Exceptions
-
Definition at line 134 of file ilBcryptPhpPasswordEncoderTest.php.
136 : void {
137 $this->expectException(ilPasswordException::class);
138 $encoder->
setCosts(self::VALID_COSTS);
140 }
encodePassword(string $raw, string $salt)
@inheritDoc
◆ testInstanceCanBeCreated()
ilBcryptPhpPasswordEncoderTest::testInstanceCanBeCreated |
( |
| ) |
|
- Returns
- ilBcryptPhpPasswordEncoder
- Exceptions
-
Definition at line 50 of file ilBcryptPhpPasswordEncoderTest.php.
51 {
53
55 $this->assertTrue((int) $default_costs_encoder->getCosts() > 4 && (int) $default_costs_encoder->getCosts() < 32);
56
58 'cost' => self::VALID_COSTS
59 ]);
60 $this->assertInstanceOf('ilBcryptPhpPasswordEncoder', $encoder);
61 $this->assertEquals(self::VALID_COSTS, $encoder->getCosts());
62 return $encoder;
63 }
skipIfPhpVersionIsNotSupported()
References skipIfPhpVersionIsNotSupported().
◆ testNameShouldBeBcryptPhp()
◆ testPasswordShouldBeCorrectlyEncodedAndVerified()
◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()
ilBcryptPhpPasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength |
( |
ilBcryptPhpPasswordEncoder |
$encoder | ) |
|
◆ testReencodingIsDetectedWhenNecessary()
◆ PASSWORD
const ilBcryptPhpPasswordEncoderTest::PASSWORD = 'password' |
◆ VALID_COSTS
const ilBcryptPhpPasswordEncoderTest::VALID_COSTS = '08' |
◆ WRONG_PASSWORD
const ilBcryptPhpPasswordEncoderTest::WRONG_PASSWORD = 'wrong_password' |
The documentation for this class was generated from the following file: