Changeset 35244 for trunk/tests/phpunit/tests/user.php
- Timestamp:
- 10/17/2015 07:24:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user.php
r35242 r35244 245 245 246 246 foreach ( $roles as $role => $level ) { 247 $user_id = self::factory()->user->create( array( 'role' => $role ) ); 247 $user_id = self::factory()->user->create( array( 248 'user_email' => 'user_19265_' . $role . '@burritos.com', 249 'user_login' => 'user_19265_' . $role, 250 'role' => $role 251 ) ); 248 252 $user = new WP_User( $user_id ); 249 253 … … 776 780 ) ); 777 781 782 $user1 = new WP_User( $u1 ); 783 784 $expected = str_repeat( 'a', 50 ); 785 $this->assertSame( $expected, $user1->user_nicename ); 786 778 787 $user_login = str_repeat( 'a', 55 ); 779 788 $u = wp_insert_user( array( … … 784 793 785 794 $this->assertNotEmpty( $u ); 786 $user = new WP_User( $u );795 $user2 = new WP_User( $u ); 787 796 $expected = str_repeat( 'a', 48 ) . '-2'; 788 $this->assertSame( $expected, $user ->user_nicename );797 $this->assertSame( $expected, $user2->user_nicename ); 789 798 } 790 799 … … 793 802 */ 794 803 public function test_wp_insert_user_should_not_truncate_to_a_duplicate_user_nicename_when_suffix_has_more_than_one_character() { 795 $user s = self::factory()->user->create_many( 4, array(804 $user_ids = self::factory()->user->create_many( 4, array( 796 805 'user_nicename' => str_repeat( 'a', 50 ), 797 806 ) ); 807 808 foreach ( $user_ids as $i => $user_id ) { 809 $user = new WP_User( $user_id ); 810 if ( 0 === $i ) { 811 $expected = str_repeat( 'a', 50 ); 812 } else { 813 $expected = str_repeat( 'a', 48 ) . '-' . ( $i + 1 ); 814 } 815 $this->assertSame( $expected, $user->user_nicename ); 816 } 798 817 799 818 $user_login = str_repeat( 'a', 55 );
Note: See TracChangeset
for help on using the changeset viewer.