Skip to content

Commit da82866

Browse files
Merge branch '7.0' into 7.1
* 7.0: Fix CI Bump ext-redis in CI on PHP >= 8.4 Adjust pretty name of closures on PHP 8.4 implement NodeVisitorInterface instead of extending AbstractNodeVisitor sync .github/expected-missing-return-types.diff skip test assertions that are no longer valid with PHP >= 8.2.18/8.3.5
2 parents e58f7a6 + 917f92e commit da82866

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Tests/Hasher/NativePasswordHasherTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ public function testBcryptWithNulByte()
104104
$hasher = new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT);
105105
$plainPassword = "a\0b";
106106

107-
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
107+
if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) {
108+
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
109+
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
110+
}
111+
108112
$this->assertTrue($hasher->verify($hasher->hash($plainPassword), $plainPassword));
109113
}
110114

Tests/Hasher/SodiumPasswordHasherTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function testBcryptWithNulByte()
7878
$hasher = new SodiumPasswordHasher(null, null);
7979
$plainPassword = "a\0b";
8080

81-
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
81+
if (\PHP_VERSION_ID < 80218 || \PHP_VERSION_ID >= 80300 && \PHP_VERSION_ID < 80305) {
82+
// password_hash() does not accept passwords containing NUL bytes since PHP 8.2.18 and 8.3.5
83+
$this->assertFalse($hasher->verify(password_hash($plainPassword, \PASSWORD_BCRYPT, ['cost' => 4]), $plainPassword));
84+
}
85+
8286
$this->assertTrue($hasher->verify((new NativePasswordHasher(null, null, 4, \PASSWORD_BCRYPT))->hash($plainPassword), $plainPassword));
8387
}
8488

0 commit comments

Comments
 (0)