WordPress.org

Make WordPress Core

Changeset 34626


Ignore:
Timestamp:
09/27/2015 03:41:11 PM (4 years ago)
Author:
boonebgorges
Message:

Add unit test verifying that 60 char user_login is valid.

Props ruudjoyo.
Fixes #33793.

File:
1 edited

Legend:

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

    r34466 r34626  
    613613
    614614        $this->assertSame( $user->user_nicename, $updated_user->user_nicename );
     615    }
     616
     617    /**
     618     * @ticket 33793
     619     */
     620    public function test_wp_insert_user_should_accept_user_login_with_60_characters() {
     621        $user_login = str_repeat( 'a', 60 );
     622        $u = wp_insert_user( array(
     623            'user_login' => $user_login,
     624            'user_email' => $user_login . '@example.com',
     625            'user_pass' => 'password',
     626            'user_nicename' => 'something-short',
     627        ) );
     628
     629        $this->assertInternalType( 'int', $u );
     630        $this->assertGreaterThan( 0, $u );
     631
     632        $user = new WP_User( $u );
     633        $this->assertSame( $user_login, $user->user_login );
    615634    }
    616635
Note: See TracChangeset for help on using the changeset viewer.