mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Login and Registration: Simplify the test for wp_signon() added in [46640].
Make sure it actually tests the change in behavior, previously it passed both before and after the patch. Add `wp_unslash()` to the last remaining instance of `$_POST['user_login']` that didn't have it. See #38744. git-svn-id: https://develop.svn.wordpress.org/trunk@46650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -387,7 +387,7 @@ class Tests_Auth extends WP_UnitTestCase {
|
||||
*
|
||||
* @ticket 9568
|
||||
*/
|
||||
function test_log_in_using_email() {
|
||||
public function test_log_in_using_email() {
|
||||
$user_args = array(
|
||||
'user_login' => 'johndoe',
|
||||
'user_email' => 'mail@example.com',
|
||||
@@ -398,4 +398,20 @@ class Tests_Auth extends WP_UnitTestCase {
|
||||
$this->assertInstanceOf( 'WP_User', wp_authenticate( $user_args['user_email'], $user_args['user_pass'] ) );
|
||||
$this->assertInstanceOf( 'WP_User', wp_authenticate( $user_args['user_login'], $user_args['user_pass'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 38744
|
||||
*/
|
||||
public function test_wp_signon_using_email_with_an_apostrophe() {
|
||||
$user_args = array(
|
||||
'user_email' => "mail\'@example.com",
|
||||
'user_pass' => 'password',
|
||||
);
|
||||
$this->factory()->user->create( $user_args );
|
||||
|
||||
$_POST['log'] = $user_args['user_email'];
|
||||
$_POST['pwd'] = $user_args['user_pass'];
|
||||
$this->assertInstanceOf( 'WP_User', wp_signon() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user