Make WordPress Core

Ticket #27304: 27304-tests.patch

File 27304-tests.patch, 1013 bytes (added by mordauk, 10 years ago)
  • tests/phpunit/tests/user.php

     
    699699                $user = get_userdata( $user->ID );
    700700                $this->assertEmpty( $user->user_activation_key );
    701701        }
     702
     703        public function test_search_users() {
     704
     705                $id = wp_insert_user( array(
     706                        'user_login' => 'user1',
     707                        'user_pass'  => 'password',
     708                        'first_name' => 'John',
     709                        'last_name'  => 'Doe',
     710                        'display_name' => 'John Doe',
     711                        'user_email' => 'blackburn@battlefield3.com',
     712                ) );
     713
     714                $users = get_users( array( 'search' => 'blackburn@battlefield3.com', 'fields' => 'ID' ) );
     715
     716                $this->assertTrue( in_array( $id, $users ) );
     717
     718                $users = get_users( array( 'search' => 'user1', 'fields' => 'ID' ) );
     719
     720                $this->assertTrue( in_array( $id, $users ) );
     721
     722                $users = get_users( array( 'search' => 'John Doe', 'fields' => 'ID' ) );
     723
     724                $this->assertTrue( in_array( $id, $users ) );
     725
     726        }
    702727}