WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/04/2019 03:04:41 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/auth.php

    r46586 r46650  
    388388     * @ticket 9568
    389389     */
    390     function test_log_in_using_email() {
     390    public function test_log_in_using_email() {
    391391        $user_args = array(
    392392            'user_login' => 'johndoe',
     
    399399        $this->assertInstanceOf( 'WP_User', wp_authenticate( $user_args['user_login'], $user_args['user_pass'] ) );
    400400    }
     401
     402    /**
     403     * @ticket 38744
     404     */
     405    public function test_wp_signon_using_email_with_an_apostrophe() {
     406        $user_args = array(
     407            'user_email' => "mail\'@example.com",
     408            'user_pass'  => 'password',
     409        );
     410        $this->factory()->user->create( $user_args );
     411
     412        $_POST['log'] = $user_args['user_email'];
     413        $_POST['pwd'] = $user_args['user_pass'];
     414        $this->assertInstanceOf( 'WP_User', wp_signon() );
     415    }
     416
    401417}
Note: See TracChangeset for help on using the changeset viewer.