- Timestamp:
- 07/12/2021 10:35:44 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r51367 r51404 248 248 249 249 $collection_data = $response->get_data(); 250 $this->assert True( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true) );250 $this->assertContains( $password_comment, wp_list_pluck( $collection_data, 'id' ) ); 251 251 } 252 252 … … 271 271 272 272 $collection_data = $response->get_data(); 273 $this->assert False( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true) );273 $this->assertNotContains( $password_comment, wp_list_pluck( $collection_data, 'id' ) ); 274 274 } 275 275 … … 311 311 312 312 $collection_data = $response->get_data(); 313 $this->assert False( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true) );313 $this->assertNotContains( $password_comment, wp_list_pluck( $collection_data, 'id' ) ); 314 314 } 315 315 … … 330 330 331 331 $collection_data = $response->get_data(); 332 $this->assert True( in_array( $password_comment, wp_list_pluck( $collection_data, 'id' ), true) );332 $this->assertContains( $password_comment, wp_list_pluck( $collection_data, 'id' ) ); 333 333 } 334 334 … … 349 349 350 350 $collection_data = $response->get_data(); 351 $this->assert False( in_array( $private_comment, wp_list_pluck( $collection_data, 'id' ), true) );351 $this->assertNotContains( $private_comment, wp_list_pluck( $collection_data, 'id' ) ); 352 352 } 353 353 … … 368 368 369 369 $collection_data = $response->get_data(); 370 $this->assert True( in_array( $private_comment, wp_list_pluck( $collection_data, 'id' ), true) );370 $this->assertContains( $private_comment, wp_list_pluck( $collection_data, 'id' ) ); 371 371 } 372 372 … … 387 387 388 388 $collection_data = $response->get_data(); 389 $this->assert False( in_array( $comment_id, wp_list_pluck( $collection_data, 'id' ), true) );389 $this->assertNotContains( $comment_id, wp_list_pluck( $collection_data, 'id' ) ); 390 390 391 391 wp_delete_comment( $comment_id ); … … 408 408 409 409 $collection_data = $response->get_data(); 410 $this->assert True( in_array( $comment_id, wp_list_pluck( $collection_data, 'id' ), true) );410 $this->assertContains( $comment_id, wp_list_pluck( $collection_data, 'id' ) ); 411 411 412 412 wp_delete_comment( $comment_id ); … … 526 526 $data = $response->get_data(); 527 527 $ids = wp_list_pluck( $data, 'id' ); 528 $this->assert True( in_array( $id1, $ids, true ));529 $this->assert True( in_array( $id2, $ids, true ));528 $this->assertContains( $id1, $ids ); 529 $this->assertContains( $id2, $ids ); 530 530 531 531 $request->set_param( 'exclude', array( $id2 ) ); … … 533 533 $data = $response->get_data(); 534 534 $ids = wp_list_pluck( $data, 'id' ); 535 $this->assert True( in_array( $id1, $ids, true ));536 $this->assert False( in_array( $id2, $ids, true ));535 $this->assertContains( $id1, $ids ); 536 $this->assertNotContains( $id2, $ids ); 537 537 538 538 // Invalid 'exclude' should error.
Note: See TracChangeset
for help on using the changeset viewer.