ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBcryptPasswordEncoderTest Class Reference
+ Inheritance diagram for ilBcryptPasswordEncoderTest:
+ Collaboration diagram for ilBcryptPasswordEncoderTest:

Public Member Functions

 getTestDirectory ()
 
 setTestDirectory (vfs\vfsStreamDirectory $testDirectory)
 
 getTestDirectoryUrl ()
 
 setTestDirectoryUrl (string $testDirectoryUrl)
 
 costsProvider ()
 
 testInstanceCanBeCreated ()
 
 testCostsCanBeRetrievedWhenCostsAreSet (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testCostsCannotBeSetAboveRange (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testCostsCannotBeSetBelowRange (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testCostsCanBeSetInRange (string $costs, ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated costsProvider More...
 
 testPasswordShouldBeCorrectlyEncodedAndVerified (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testEncoderReliesOnSalts (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testEncoderDoesNotSupportReencoding (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testNameShouldBeBcrypt (ilBcryptPasswordEncoder $encoder)
 testInstanceCanBeCreated More...
 
 testExceptionIsRaisedIfSaltIsMissingIsOnEncoding ()
 
 testExceptionIsRaisedIfSaltIsMissingIsOnVerification ()
 
 testInstanceCanBeCreatedAndInitializedWithClientSalt ()
 
 testClientSaltIsGeneratedWhenNoClientSaltExistsYet ()
 
 testExceptionIsRaisedWhenClientSaltCouldNotBeGeneratedInCaseNoClientSaltExistsYet ()
 
 testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet ()
 
 testBackwardCompatibility ()
 
 testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled ()
 
 testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw ()
 

Data Fields

const VALID_COSTS = '08'
 
const PASSWORD = 'password'
 
const WRONG_PASSWORD = 'wrong_password'
 
const CLIENT_SALT = 'homer!12345_/'
 
const PASSWORD_SALT = 'salt'
 

Protected Attributes

 $testDirectory
 
 $testDirectoryUrl
 

Private Member Functions

 skipIfPhpVersionIsNotSupported ()
 
 isVsfStreamInstalled ()
 
 skipIfvfsStreamNotSupported ()
 
 getInstanceWithConfiguredDataDirectory ()
 

Detailed Description

Definition at line 14 of file ilBcryptPasswordEncoderTest.php.

Member Function Documentation

◆ costsProvider()

ilBcryptPasswordEncoderTest::costsProvider ( )
Returns
array

Definition at line 104 of file ilBcryptPasswordEncoderTest.php.

References $data, and $i.

104  : array
105  {
106  $data = [];
107  for ($i = 4; $i <= 31; $i++) {
108  $data[sprintf("Costs: %s", (string) $i)] = [(string) $i];
109  }
110 
111  return $data;
112  }
$data
Definition: storeScorm.php:23
$i
Definition: metadata.php:24

◆ getInstanceWithConfiguredDataDirectory()

◆ getTestDirectory()

ilBcryptPasswordEncoderTest::getTestDirectory ( )

◆ getTestDirectoryUrl()

ilBcryptPasswordEncoderTest::getTestDirectoryUrl ( )
Returns
string

Definition at line 56 of file ilBcryptPasswordEncoderTest.php.

References $testDirectoryUrl.

Referenced by getInstanceWithConfiguredDataDirectory(), and testInstanceCanBeCreated().

56  : string
57  {
59  }
+ Here is the caller graph for this function:

◆ isVsfStreamInstalled()

ilBcryptPasswordEncoderTest::isVsfStreamInstalled ( )
private
Returns
bool

Definition at line 82 of file ilBcryptPasswordEncoderTest.php.

Referenced by skipIfvfsStreamNotSupported().

82  : bool
83  {
84  return class_exists('org\bovigo\vfs\vfsStreamWrapper');
85  }
+ Here is the caller graph for this function:

◆ setTestDirectory()

ilBcryptPasswordEncoderTest::setTestDirectory ( vfs\vfsStreamDirectory  $testDirectory)
Parameters
vfs\vfsStreamDirectory$testDirectory

Definition at line 48 of file ilBcryptPasswordEncoderTest.php.

References $testDirectory.

Referenced by skipIfvfsStreamNotSupported().

48  : void
49  {
50  $this->testDirectory = $testDirectory;
51  }
+ Here is the caller graph for this function:

◆ setTestDirectoryUrl()

ilBcryptPasswordEncoderTest::setTestDirectoryUrl ( string  $testDirectoryUrl)
Parameters
string$testDirectoryUrl

Definition at line 64 of file ilBcryptPasswordEncoderTest.php.

References $testDirectoryUrl.

Referenced by skipIfvfsStreamNotSupported().

64  : void
65  {
66  $this->testDirectoryUrl = $testDirectoryUrl;
67  }
+ Here is the caller graph for this function:

◆ skipIfPhpVersionIsNotSupported()

ilBcryptPasswordEncoderTest::skipIfPhpVersionIsNotSupported ( )
private

Definition at line 72 of file ilBcryptPasswordEncoderTest.php.

Referenced by testBackwardCompatibility().

72  : void
73  {
74  if (version_compare(phpversion(), '5.3.7', '<')) {
75  $this->markTestSkipped('Requires PHP >= 5.3.7');
76  }
77  }
+ Here is the caller graph for this function:

◆ skipIfvfsStreamNotSupported()

ilBcryptPasswordEncoderTest::skipIfvfsStreamNotSupported ( )
private

Definition at line 90 of file ilBcryptPasswordEncoderTest.php.

References isVsfStreamInstalled(), setTestDirectory(), and setTestDirectoryUrl().

Referenced by testBackwardCompatibility(), testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet(), testClientSaltIsGeneratedWhenNoClientSaltExistsYet(), testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled(), testExceptionIsRaisedIfSaltIsMissingIsOnEncoding(), testExceptionIsRaisedIfSaltIsMissingIsOnVerification(), testExceptionIsRaisedWhenClientSaltCouldNotBeGeneratedInCaseNoClientSaltExistsYet(), testInstanceCanBeCreated(), testInstanceCanBeCreatedAndInitializedWithClientSalt(), and testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw().

90  : void
91  {
92  if (!$this->isVsfStreamInstalled()) {
93  $this->markTestSkipped('Skipped test, vfsStream (http://vfs.bovigo.org) required');
94  } else {
95  vfs\vfsStream::setup();
96  $this->setTestDirectory(vfs\vfsStream::newDirectory('tests')->at(vfs\vfsStreamWrapper::getRoot()));
97  $this->setTestDirectoryUrl(vfs\vfsStream::url('root/tests'));
98  }
99  }
setTestDirectory(vfs\vfsStreamDirectory $testDirectory)
setTestDirectoryUrl(string $testDirectoryUrl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testBackwardCompatibility()

ilBcryptPasswordEncoderTest::testBackwardCompatibility ( )
Exceptions
ilPasswordException

Definition at line 360 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), skipIfPhpVersionIsNotSupported(), and skipIfvfsStreamNotSupported().

360  : void
361  {
364 
365  $encoder = $this->getInstanceWithConfiguredDataDirectory();
366  $encoder->setClientSalt(self::CLIENT_SALT);
367  $encoder->setBackwardCompatibility(true);
368  $encoded_password = $encoder->encodePassword(self::PASSWORD, self::PASSWORD_SALT);
369  $this->assertTrue($encoder->isPasswordValid($encoded_password, self::PASSWORD, self::PASSWORD_SALT));
370  $this->assertEquals('$2a$', substr($encoded_password, 0, 4));
371 
372  $another_encoder = $this->getInstanceWithConfiguredDataDirectory();
373  $another_encoder->setClientSalt(self::CLIENT_SALT);
374  $another_encoder->setBackwardCompatibility(false);
375  $another_encoded_password = $another_encoder->encodePassword(self::PASSWORD, self::PASSWORD_SALT);
376  $this->assertEquals('$2y$', substr($another_encoded_password, 0, 4));
377  $this->assertTrue($another_encoder->isPasswordValid($encoded_password, self::PASSWORD, self::PASSWORD_SALT));
378  }
+ Here is the call graph for this function:

◆ testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet()

ilBcryptPasswordEncoderTest::testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet ( )
Exceptions
ilPasswordException

Definition at line 346 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), and skipIfvfsStreamNotSupported().

346  : void
347  {
349 
350  $encoder = $this->getInstanceWithConfiguredDataDirectory();
351  $encoder->setBackwardCompatibility(true);
352  $this->assertTrue($encoder->isBackwardCompatibilityEnabled());
353  $encoder->setBackwardCompatibility(false);
354  $this->assertFalse($encoder->isBackwardCompatibilityEnabled());
355  }
+ Here is the call graph for this function:

◆ testClientSaltIsGeneratedWhenNoClientSaltExistsYet()

ilBcryptPasswordEncoderTest::testClientSaltIsGeneratedWhenNoClientSaltExistsYet ( )
Exceptions
ilPasswordException

Definition at line 320 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), getTestDirectory(), and skipIfvfsStreamNotSupported().

320  : void
321  {
323 
324  $this->getTestDirectory()->chmod(0777);
325 
326  $encoder = $this->getInstanceWithConfiguredDataDirectory();
327  $this->assertNotNull($encoder->getClientSalt());
328  }
+ Here is the call graph for this function:

◆ testCostsCanBeRetrievedWhenCostsAreSet()

ilBcryptPasswordEncoderTest::testCostsCanBeRetrievedWhenCostsAreSet ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 164 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPhpPasswordEncoder\getCosts(), and ilBcryptPhpPasswordEncoder\setCosts().

164  : void
165  {
166  $expected = '04';
167 
168  $encoder->setCosts($expected);
169  $this->assertEquals($expected, $encoder->getCosts());
170  }
+ Here is the call graph for this function:

◆ testCostsCanBeSetInRange()

ilBcryptPasswordEncoderTest::testCostsCanBeSetInRange ( string  $costs,
ilBcryptPasswordEncoder  $encoder 
)

testInstanceCanBeCreated costsProvider

Parameters
string$costs
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 202 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPhpPasswordEncoder\setCosts().

202  : void
203  {
204  $encoder->setCosts($costs);
205  }
+ Here is the call graph for this function:

◆ testCostsCannotBeSetAboveRange()

ilBcryptPasswordEncoderTest::testCostsCannotBeSetAboveRange ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 177 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPhpPasswordEncoder\setCosts().

177  : void
178  {
179  $this->expectException(ilPasswordException::class);
180  $encoder->setCosts('32');
181  }
+ Here is the call graph for this function:

◆ testCostsCannotBeSetBelowRange()

ilBcryptPasswordEncoderTest::testCostsCannotBeSetBelowRange ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 188 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPhpPasswordEncoder\setCosts().

188  : void
189  {
190  $this->expectException(ilPasswordException::class);
191  $encoder->setCosts('3');
192  }
+ Here is the call graph for this function:

◆ testEncoderDoesNotSupportReencoding()

ilBcryptPasswordEncoderTest::testEncoderDoesNotSupportReencoding ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder

Definition at line 261 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\requiresReencoding().

261  : void
262  {
263  $this->assertFalse($encoder->requiresReencoding('hello'));
264  }
+ Here is the call graph for this function:

◆ testEncoderReliesOnSalts()

ilBcryptPasswordEncoderTest::testEncoderReliesOnSalts ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder

Definition at line 252 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\requiresSalt().

252  : void
253  {
254  $this->assertTrue($encoder->requiresSalt());
255  }
+ Here is the call graph for this function:

◆ testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled()

ilBcryptPasswordEncoderTest::testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled ( )
Exceptions
ilPasswordException

Definition at line 383 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), and skipIfvfsStreamNotSupported().

383  : void
384  {
386 
387  $this->expectException(ilPasswordException::class);
388  $encoder = $this->getInstanceWithConfiguredDataDirectory();
389  $encoder->setClientSalt(self::CLIENT_SALT);
390  $encoder->setBackwardCompatibility(true);
391  $encoder->encodePassword(self::PASSWORD . chr(195), self::PASSWORD_SALT);
392  }
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfSaltIsMissingIsOnEncoding()

ilBcryptPasswordEncoderTest::testExceptionIsRaisedIfSaltIsMissingIsOnEncoding ( )
Exceptions
ilPasswordException

Definition at line 278 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), and skipIfvfsStreamNotSupported().

278  : void
279  {
281 
282  $this->expectException(ilPasswordException::class);
283  $encoder = $this->getInstanceWithConfiguredDataDirectory();
284  $encoder->setClientSalt(null);
285  $encoder->setCosts(self::VALID_COSTS);
286  $encoder->encodePassword(self::PASSWORD, self::PASSWORD_SALT);
287  }
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfSaltIsMissingIsOnVerification()

ilBcryptPasswordEncoderTest::testExceptionIsRaisedIfSaltIsMissingIsOnVerification ( )
Exceptions
ilPasswordException

Definition at line 292 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), and skipIfvfsStreamNotSupported().

292  : void
293  {
295 
296  $this->expectException(ilPasswordException::class);
297  $encoder = $this->getInstanceWithConfiguredDataDirectory();
298  $encoder->setClientSalt(null);
299  $encoder->setCosts(self::VALID_COSTS);
300  $encoder->isPasswordValid('12121212', self::PASSWORD, self::PASSWORD_SALT);
301  }
+ Here is the call graph for this function:

◆ testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding()

ilBcryptPasswordEncoderTest::testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 228 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\encodePassword(), and ilBcryptPhpPasswordEncoder\setCosts().

230  : void {
231  $this->expectException(ilPasswordException::class);
232  $encoder->setCosts(self::VALID_COSTS);
233  $encoder->encodePassword(str_repeat('a', 5000), self::PASSWORD_SALT);
234  }
encodePassword(string $raw, string $salt)
+ Here is the call graph for this function:

◆ testExceptionIsRaisedWhenClientSaltCouldNotBeGeneratedInCaseNoClientSaltExistsYet()

ilBcryptPasswordEncoderTest::testExceptionIsRaisedWhenClientSaltCouldNotBeGeneratedInCaseNoClientSaltExistsYet ( )
Exceptions
ilPasswordException

Definition at line 333 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), getTestDirectory(), and skipIfvfsStreamNotSupported().

333  : void
334  {
336 
337  $this->expectException(ilPasswordException::class);
338  $this->getTestDirectory()->chmod(0000);
339 
341  }
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilBcryptPasswordEncoderTest::testInstanceCanBeCreated ( )
Returns
ilBcryptPasswordEncoder
Exceptions
ilPasswordException

Definition at line 131 of file ilBcryptPasswordEncoderTest.php.

References getTestDirectoryUrl(), and skipIfvfsStreamNotSupported().

132  {
134 
135  $security_flaw_ignoring_encoder = new ilBcryptPasswordEncoder([
136  'ignore_security_flaw' => true,
137  'data_directory' => $this->getTestDirectoryUrl()
138  ]);
139  $this->assertTrue($security_flaw_ignoring_encoder->isSecurityFlawIgnored());
140 
141  $security_flaw_respecting_encoder = new ilBcryptPasswordEncoder([
142  'ignore_security_flaw' => false,
143  'data_directory' => $this->getTestDirectoryUrl()
144  ]);
145  $this->assertFalse($security_flaw_respecting_encoder->isSecurityFlawIgnored());
146 
147  $encoder = new ilBcryptPasswordEncoder([
148  'cost' => self::VALID_COSTS,
149  'data_directory' => $this->getTestDirectoryUrl()
150  ]);
151  $this->assertInstanceOf('ilBcryptPasswordEncoder', $encoder);
152  $this->assertEquals(self::VALID_COSTS, $encoder->getCosts());
153  $this->assertFalse($encoder->isSecurityFlawIgnored());
154  $encoder->setClientSalt(self::CLIENT_SALT);
155 
156  return $encoder;
157  }
+ Here is the call graph for this function:

◆ testInstanceCanBeCreatedAndInitializedWithClientSalt()

ilBcryptPasswordEncoderTest::testInstanceCanBeCreatedAndInitializedWithClientSalt ( )
Exceptions
ilPasswordException

Definition at line 306 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), getTestDirectory(), ilBcryptPasswordEncoder\SALT_STORAGE_FILENAME, and skipIfvfsStreamNotSupported().

306  : void
307  {
309 
310  $this->getTestDirectory()->chmod(0777);
311  vfs\vfsStream::newFile(ilBcryptPasswordEncoder::SALT_STORAGE_FILENAME)->withContent(self::CLIENT_SALT)->at($this->getTestDirectory());
312 
313  $encoder = $this->getInstanceWithConfiguredDataDirectory();
314  $this->assertEquals(self::CLIENT_SALT, $encoder->getClientSalt());
315  }
+ Here is the call graph for this function:

◆ testNameShouldBeBcrypt()

ilBcryptPasswordEncoderTest::testNameShouldBeBcrypt ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder

Definition at line 270 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\getName().

270  : void
271  {
272  $this->assertEquals('bcrypt', $encoder->getName());
273  }
+ Here is the call graph for this function:

◆ testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw()

ilBcryptPasswordEncoderTest::testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw ( )

Exceptions
ilPasswordException

Definition at line 398 of file ilBcryptPasswordEncoderTest.php.

References getInstanceWithConfiguredDataDirectory(), and skipIfvfsStreamNotSupported().

398  : void
399  {
401 
402  $encoder = $this->getInstanceWithConfiguredDataDirectory();
403  $encoder->setClientSalt(self::CLIENT_SALT);
404  $encoder->setBackwardCompatibility(true);
405  $encoder->setIsSecurityFlawIgnored(true);
406  $encoder->encodePassword(self::PASSWORD . chr(195), self::PASSWORD_SALT);
407  }
+ Here is the call graph for this function:

◆ testPasswordShouldBeCorrectlyEncodedAndVerified()

ilBcryptPasswordEncoderTest::testPasswordShouldBeCorrectlyEncodedAndVerified ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Returns
ilBcryptPasswordEncoder
Exceptions
ilPasswordException

Definition at line 213 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\encodePassword(), ilBcryptPasswordEncoder\isPasswordValid(), and ilBcryptPhpPasswordEncoder\setCosts().

216  $encoder->setCosts(self::VALID_COSTS);
217  $encoded_password = $encoder->encodePassword(self::PASSWORD, self::PASSWORD_SALT);
218  $this->assertTrue($encoder->isPasswordValid($encoded_password, self::PASSWORD, self::PASSWORD_SALT));
219  $this->assertFalse($encoder->isPasswordValid($encoded_password, self::WRONG_PASSWORD, self::PASSWORD_SALT));
220  return $encoder;
221  }
encodePassword(string $raw, string $salt)
isPasswordValid(string $encoded, string $raw, string $salt)
+ Here is the call graph for this function:

◆ testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength()

ilBcryptPasswordEncoderTest::testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength ( ilBcryptPasswordEncoder  $encoder)

testInstanceCanBeCreated

Parameters
ilBcryptPasswordEncoder$encoder
Exceptions
ilPasswordException

Definition at line 241 of file ilBcryptPasswordEncoderTest.php.

References ilBcryptPasswordEncoder\isPasswordValid(), and ilBcryptPhpPasswordEncoder\setCosts().

243  : void {
244  $encoder->setCosts(self::VALID_COSTS);
245  $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), self::PASSWORD_SALT));
246  }
isPasswordValid(string $encoded, string $raw, string $salt)
+ Here is the call graph for this function:

Field Documentation

◆ $testDirectory

ilBcryptPasswordEncoderTest::$testDirectory
protected

Definition at line 32 of file ilBcryptPasswordEncoderTest.php.

Referenced by getTestDirectory(), and setTestDirectory().

◆ $testDirectoryUrl

ilBcryptPasswordEncoderTest::$testDirectoryUrl
protected

Definition at line 35 of file ilBcryptPasswordEncoderTest.php.

Referenced by getTestDirectoryUrl(), and setTestDirectoryUrl().

◆ CLIENT_SALT

const ilBcryptPasswordEncoderTest::CLIENT_SALT = 'homer!12345_/'

Definition at line 26 of file ilBcryptPasswordEncoderTest.php.

◆ PASSWORD

const ilBcryptPasswordEncoderTest::PASSWORD = 'password'

Definition at line 20 of file ilBcryptPasswordEncoderTest.php.

◆ PASSWORD_SALT

const ilBcryptPasswordEncoderTest::PASSWORD_SALT = 'salt'

Definition at line 29 of file ilBcryptPasswordEncoderTest.php.

◆ VALID_COSTS

const ilBcryptPasswordEncoderTest::VALID_COSTS = '08'

Definition at line 17 of file ilBcryptPasswordEncoderTest.php.

◆ WRONG_PASSWORD

const ilBcryptPasswordEncoderTest::WRONG_PASSWORD = 'wrong_password'

Definition at line 23 of file ilBcryptPasswordEncoderTest.php.


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