mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-20 15:52:47 +00:00
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
35 lines
821 B
PHP
35 lines
821 B
PHP
<?php
|
|
|
|
/**
|
|
* Tests for the PasswordHash external library.
|
|
*
|
|
* @covers PasswordHash
|
|
*/
|
|
class Tests_User_PasswordHash extends WP_UnitTestCase {
|
|
|
|
public static function set_up_before_class() {
|
|
parent::set_up_before_class();
|
|
|
|
require_once ABSPATH . WPINC . '/class-phpass.php';
|
|
}
|
|
|
|
/**
|
|
* Tests that PasswordHash::gensalt_blowfish() does not throw a deprecation notice on PHP 8.1.
|
|
*
|
|
* 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_on_php81() {
|
|
$hasher = new PasswordHash( 8, true );
|
|
$hasher->gensalt_blowfish( 'a password string' );
|
|
}
|
|
|
|
}
|