forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users: Set correct default value for
$user_login
in `retrieve_passw…
…ord()`. This resolves a "passing null to non-nullable" deprecation notice on PHP 8.1+: {{{ Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated }}} Follow-up to [50129], [54477]. Props afragen, peterwilsoncc, SergeyBiryukov. Fixes #62298. git-svn-id: https://develop.svn.wordpress.org/trunk@59312 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
1 parent
58b5c63
commit 6bc26d5
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,17 @@ public function test_retrieve_password_should_fetch_user_by_login_if_not_found_b | |
$this->assertTrue( retrieve_password( '[email protected]' ), 'Fetching user by login failed.' ); | ||
$this->assertTrue( retrieve_password( '[email protected]' ), 'Fetching user by email failed.' ); | ||
} | ||
|
||
/** | ||
* Tests that PHP 8.1 "passing null to non-nullable" deprecation notice | ||
* is not thrown when the `$user_login` parameter is empty. | ||
* | ||
* The notice that we should not see: | ||
* `Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated`. | ||
* | ||
* @ticket 62298 | ||
*/ | ||
public function test_retrieve_password_does_not_throw_deprecation_notice_with_default_parameters() { | ||
$this->assertWPError( retrieve_password() ); | ||
} | ||
} |