- Timestamp:
- 07/12/2021 10:35:44 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r51403 r51404 278 278 $user_ids = wp_list_pluck( $users, 'id' ); 279 279 280 $this->assert True( in_array( self::$editor, $user_ids, true ));281 $this->assert True( in_array( self::$authors['r_true_p_true'], $user_ids, true ));282 $this->assert True( in_array( self::$authors['r_true_p_false'], $user_ids, true ));280 $this->assertContains( self::$editor, $user_ids ); 281 $this->assertContains( self::$authors['r_true_p_true'], $user_ids ); 282 $this->assertContains( self::$authors['r_true_p_false'], $user_ids ); 283 283 $this->assertCount( 3, $user_ids ); 284 284 } … … 290 290 $user_ids = wp_list_pluck( $users, 'id' ); 291 291 292 $this->assert False( in_array( self::$authors['r_false_p_true'], $user_ids, true ));293 $this->assert False( in_array( self::$authors['r_false_p_false'], $user_ids, true ));292 $this->assertNotContains( self::$authors['r_false_p_true'], $user_ids ); 293 $this->assertNotContains( self::$authors['r_false_p_false'], $user_ids ); 294 294 } 295 295 … … 300 300 $user_ids = wp_list_pluck( $users, 'id' ); 301 301 302 $this->assert False( in_array( self::$draft_editor, $user_ids, true ));303 $this->assert False( in_array( self::$user, $user_ids, true ));302 $this->assertNotContains( self::$draft_editor, $user_ids ); 303 $this->assertNotContains( self::$user, $user_ids ); 304 304 } 305 305 … … 634 634 $data = $response->get_data(); 635 635 $ids = wp_list_pluck( $data, 'id' ); 636 $this->assert True( in_array( $id1, $ids, true ));637 $this->assert True( in_array( $id2, $ids, true ));636 $this->assertContains( $id1, $ids ); 637 $this->assertContains( $id2, $ids ); 638 638 639 639 $request->set_param( 'exclude', array( $id2 ) ); … … 641 641 $data = $response->get_data(); 642 642 $ids = wp_list_pluck( $data, 'id' ); 643 $this->assert True( in_array( $id1, $ids, true ));644 $this->assert False( in_array( $id2, $ids, true ));643 $this->assertContains( $id1, $ids ); 644 $this->assertNotContains( $id2, $ids ); 645 645 646 646 // Invalid 'exclude' should error.
Note: See TracChangeset
for help on using the changeset viewer.