public function testPasswordCheckSupported() { $validPassword = 'valid password';
// cspell:disable
$passwordHash = '$S$5TOxWPdvJRs0P/xZBdrrPlGgzViOS0drHu3jaIjitesfttrp18bk';
$passwordLayered = 'U$S$5vNHDQyLqCTvsYBLWBUWXJWhA0m3DTpBh04acFEOGB.bKBclhKgo';
// cspell:enable
$invalidPassword = 'invalid password';
$corePassword =
$this->
prophesize(PasswordInterface::
class);
$corePassword->
check()->
shouldNotBeCalled();
$passwordService =
new PhpassHashedPassword($corePassword->
reveal());
$result =
$passwordService->
check($validPassword,
$passwordHash);
$this->
assertTrue($result, 'Accepts valid passwords created prior to 10.1.x'
);
$result =
$passwordService->
check($invalidPassword,
$passwordHash);
$this->
assertFalse($result, 'Rejects invalid passwords created prior to 10.1.x'
);
$result =
$passwordService->
check($validPassword,
$passwordLayered);
$this->
assertTrue($result, 'Accepts valid passwords migrated from sites running 6.x'
);
$result =
$passwordService->
check($invalidPassword,
$passwordLayered);