Skip to content

Commit

Permalink
Correct the args for WP_User_Query
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke committed May 28, 2024
1 parent 0c1fd32 commit 6d2df28
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/phpunit/test-wp-user-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testQueryForAuthorWithPublishedPostsReturnsAttributedAuthors() :
] );

$common_args = [
'fields' => 'ids',
'fields' => 'ID',
'orderby' => 'ID',
'order' => 'ASC',
];
Expand All @@ -83,8 +83,7 @@ public function testQueryForAuthorWithPublishedPostsReturnsAttributedAuthors() :
$test_key => $test_value,
] );

$query = new WP_User_Query();
$users = $query->query( $args );
$users = new WP_User_Query( $args );

$this->assertSame(
[ self::$users['editor']->ID, self::$users[ GUEST_ROLE ]->ID ],
Expand All @@ -103,8 +102,7 @@ public function testQueryForAuthorWithPublishedPostsReturnsAttributedAuthors() :
$test_key => $test_value,
] );

$query = new WP_User_Query();
$users = $query->query( $args );
$users = new WP_User_Query( $args );

$this->assertSame(
[ self::$users['admin']->ID, self::$users['author']->ID ],
Expand All @@ -123,8 +121,7 @@ public function testQueryForAuthorWithPublishedPostsReturnsAttributedAuthors() :
$test_key => $test_value,
] );

$query = new WP_User_Query();
$users = $query->query( $args );
$users = new WP_User_Query( $args );

$this->assertSame(
[
Expand Down

0 comments on commit 6d2df28

Please sign in to comment.