Tests: Move PasswordHash test file to a more appropriate place.

While also used for post passwords and application passwords, the PasswordHash library appears to be initially introduced and primarily used for user passwords, so the test file can be moved to the `user` directory.

Follow-up to [6350], [55310].

See #56340.

git-svn-id: https://develop.svn.wordpress.org/trunk@55313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2023-02-13 14:20:30 +00:00
parent 428705ba1f
commit 86da994b9a

View File

@ -5,7 +5,7 @@
*
* @covers PasswordHash
*/
class Tests_PasswordHash extends WP_UnitTestCase {
class Tests_User_PasswordHash extends WP_UnitTestCase {
public static function set_up_before_class() {
parent::set_up_before_class();
@ -14,22 +14,21 @@ class Tests_PasswordHash extends WP_UnitTestCase {
}
/**
* Tests that PasswordHash::gensalt_blowfish() does not throw a deprecation
* notice on PHP 8.1 for "Implicit conversion from float to int loses precision".
* Tests that PasswordHash::gensalt_blowfish() does not throw a deprecation notice on PHP 8.1.
*
* Should this test fail, it will produce an error "E" in the results.
* The notice that we should not see:
* `Deprecated: Implicit conversion from float to int loses precision`.
*
* @ticket 56340
*
* @covers PasswordHash::gensalt_blowfish
*
* @requires PHP 8.1
* @doesNotPerformAssertions
*/
public function test_gensalt_blowfish_should_not_throw_deprecation_notice_in_php81() {
$this->expectNotToPerformAssertions();
$hasher = new PasswordHash( 8, true );
$hasher->gensalt_blowfish( 'a password string' );
public function test_gensalt_blowfish_should_not_throw_deprecation_notice_on_php81() {
$hasher = new PasswordHash( 8, true );
$hasher->gensalt_blowfish( 'a password string' );
}
}