WordPress.org

Make WordPress Core

Changeset 49126


Ignore:
Timestamp:
10/11/2020 03:49:30 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in test_edit_user_blank_password(), for consistency with other assertions.

Follow-up to [49118].

See #42766, #38266.

File:
1 edited

Legend:

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

    r49118 r49126  
    14541454     * @ticket 42766
    14551455     */
    1456     function test_edit_user_blank_pw() {
     1456    function test_edit_user_blank_password() {
    14571457        $_POST                 = array();
    14581458        $_GET                  = array();
     
    14931493        $this->assertSame( 'nickname_updated', $user->nickname );
    14941494
    1495         // Check not to change an old password if a new password contains only spaces. Ticket #42766
     1495        // Check not to change an old password if a new password contains only spaces. Ticket #42766.
    14961496        $user           = get_user_by( 'ID', $user_id );
    14971497        $old_pass       = $user->user_pass;
     
    15031503
    15041504        $this->assertInternalType( 'int', $user_id );
    1505         $this->assertEquals( $old_pass, $user->user_pass );
     1505        $this->assertSame( $old_pass, $user->user_pass );
    15061506
    15071507        // Check updating user with missing second password.
     
    15171517
    15181518        // Check updating user with empty password via `check_passwords` action.
    1519         add_action( 'check_passwords', array( $this, 'action_check_passwords_blank_pw' ), 10, 2 );
     1519        add_action( 'check_passwords', array( $this, 'action_check_passwords_blank_password' ), 10, 2 );
    15201520        $user_id = edit_user( $user_id );
    1521         remove_action( 'check_passwords', array( $this, 'action_check_passwords_blank_pw' ) );
     1521        remove_action( 'check_passwords', array( $this, 'action_check_passwords_blank_password' ) );
    15221522
    15231523        $this->assertInternalType( 'int', $user_id );
     
    15261526
    15271527    /**
    1528      * Check passwords action for test_edit_user_blank_pw().
    1529      */
    1530     function action_check_passwords_blank_pw( $user_login, &$pass1 ) {
     1528     * Check passwords action for test_edit_user_blank_password().
     1529     */
     1530    function action_check_passwords_blank_password( $user_login, &$pass1 ) {
    15311531        $pass1 = '';
    15321532    }
Note: See TracChangeset for help on using the changeset viewer.