Build/Test Tools: Add unit tests for wp_set_password hook.

Follow-up to [55056].

Props audrasjb, SergeyBiryukov, costdev.
Fixes #57436.


git-svn-id: https://develop.svn.wordpress.org/trunk@55250 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2023-02-07 09:24:00 +00:00
parent e146f22ddf
commit face5a97dd

View File

@ -100,6 +100,22 @@ class Tests_Auth extends WP_UnitTestCase {
}
}
/**
* Tests hooking into wp_set_password().
*
* @ticket 57436
*
* @covers ::wp_set_password
*/
public function test_wp_set_password_action() {
$action = new MockAction();
add_action( 'wp_set_password', array( $action, 'action' ) );
wp_set_password( 'A simple password', self::$user_id );
$this->assertSame( 1, $action->get_call_count() );
}
/**
* Test wp_hash_password trims whitespace
*