From 86da994b9a7040698990ac4def25a85ecc761146 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 13 Feb 2023 14:20:30 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/{ => user}/passwordHash.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename tests/phpunit/tests/{ => user}/passwordHash.php (55%) diff --git a/tests/phpunit/tests/passwordHash.php b/tests/phpunit/tests/user/passwordHash.php similarity index 55% rename from tests/phpunit/tests/passwordHash.php rename to tests/phpunit/tests/user/passwordHash.php index a764159e09..1179ba25b2 100644 --- a/tests/phpunit/tests/passwordHash.php +++ b/tests/phpunit/tests/user/passwordHash.php @@ -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' ); } }