Changeset 32980
- Timestamp:
- 06/28/2015 12:35:42 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r32904 r32980 798 798 $search_columns = array('user_url'); 799 799 else 800 $search_columns = array('user_login', 'user_ nicename');800 $search_columns = array('user_login', 'user_url', 'user_email', 'user_nicename', 'display_name'); 801 801 } 802 802 -
trunk/tests/phpunit/tests/user.php
r32904 r32980 6 6 */ 7 7 class Tests_User extends WP_UnitTestCase { 8 9 protected $user_data; 10 11 function setUp() { 12 parent::setUp(); 13 14 $this->user_data = array( 15 'user_login' => 'user1', 16 'user_nicename' => 'userone', 17 'user_pass' => 'password', 18 'first_name' => 'John', 19 'last_name' => 'Doe', 20 'display_name' => 'John Doe', 21 'user_email' => 'blackburn@battlefield3.com', 22 'user_url' => 'http://tacos.com' 23 ); 24 } 8 25 9 26 function test_get_users_of_blog() { … … 637 654 $this->assertEquals( $id2, email_exists( 'miller@battlefield3.com' ) ); 638 655 639 if( ! is_wp_error( $id2 ) ){ 656 if( ! is_wp_error( $id2 ) ){ 640 657 $return = wp_update_user( array( 641 658 'ID' => $id2, … … 650 667 if ( ! defined( 'WP_IMPORTING' ) ) { 651 668 $this->assertWPError( $return ); 652 } 669 } 653 670 } 654 671 } … … 700 717 $this->assertEmpty( $user->user_activation_key ); 701 718 } 719 720 public function test_search_users_login() { 721 $id = $this->factory->user->create( $this->user_data ); 722 723 $users = get_users( array( 'search' => 'user1', 'fields' => 'ID' ) ); 724 725 $this->assertTrue( in_array( $id, $users ) ); 726 } 727 728 public function test_search_users_url() { 729 $id = $this->factory->user->create( $this->user_data ); 730 731 $users = get_users( array( 'search' => '*tacos*', 'fields' => 'ID' ) ); 732 733 $this->assertTrue( in_array( $id, $users ) ); 734 } 735 736 public function test_search_users_email() { 737 $id = $this->factory->user->create( $this->user_data ); 738 739 $users = get_users( array( 'search' => '*battle*', 'fields' => 'ID' ) ); 740 741 $this->assertTrue( in_array( $id, $users ) ); 742 } 743 744 public function test_search_users_nicename() { 745 $id = $this->factory->user->create( $this->user_data ); 746 747 $users = get_users( array( 'search' => '*one*', 'fields' => 'ID' ) ); 748 749 $this->assertTrue( in_array( $id, $users ) ); 750 } 751 752 public function test_search_users_display_name() { 753 $id = $this->factory->user->create( $this->user_data ); 754 755 $users = get_users( array( 'search' => '*Doe*', 'fields' => 'ID' ) ); 756 757 $this->assertTrue( in_array( $id, $users ) ); 758 } 702 759 }
Note: See TracChangeset
for help on using the changeset viewer.