diff --git a/tests/TestCase/Authenticator/CookieAuthenticatorTest.php b/tests/TestCase/Authenticator/CookieAuthenticatorTest.php index a876888b..1c32bfb0 100644 --- a/tests/TestCase/Authenticator/CookieAuthenticatorTest.php +++ b/tests/TestCase/Authenticator/CookieAuthenticatorTest.php @@ -301,8 +301,12 @@ public function testPersistIdentity() $this->assertArrayHasKey('response', $result); $this->assertInstanceOf(RequestInterface::class, $result['request']); $this->assertInstanceOf(ResponseInterface::class, $result['response']); + $hashCost = '10'; + if (PHP_VERSION_ID >= 80400) { + $hashCost = '12'; + } $this->assertStringContainsString( - 'CookieAuth=%5B%22mariano%22%2C%22%242y%2410%24', // `CookieAuth=["mariano","$2y$10$` + 'CookieAuth=%5B%22mariano%22%2C%22%242y%24' . $hashCost . '%24', // `CookieAuth=["mariano","$2y$10$` $result['response']->getHeaderLine('Set-Cookie') ); $this->assertStringContainsString( diff --git a/tests/TestCase/PasswordHasher/LegacyPasswordHasherTest.php b/tests/TestCase/PasswordHasher/LegacyPasswordHasherTest.php index 85225edd..b11b7796 100644 --- a/tests/TestCase/PasswordHasher/LegacyPasswordHasherTest.php +++ b/tests/TestCase/PasswordHasher/LegacyPasswordHasherTest.php @@ -47,7 +47,11 @@ public function testNeedsRehash() $hasher = new LegacyPasswordHasher(); $this->assertTrue($hasher->needsRehash(md5('foo'))); $this->assertTrue($hasher->needsRehash('bar')); - $this->assertFalse($hasher->needsRehash('$2y$10$juOA0XVFpvZa0KTxRxEYVuX5kIS7U1fKDRcxyYhhUQECN1oHYnBMy')); + $hashCost = '10'; + if (PHP_VERSION_ID >= 80400) { + $hashCost = '12'; + } + $this->assertFalse($hasher->needsRehash('$2y$' . $hashCost . '$juOA0XVFpvZa0KTxRxEYVuX5kIS7U1fKDRcxyYhhUQECN1oHYnBMy')); } /**