- Timestamp:
- 07/07/2021 10:32:56 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r51331 r51367 416 416 $request = new WP_REST_Request( 'GET', '/wp/v2/media' ); 417 417 $response = rest_get_server()->dispatch( $request ); 418 $this->assert Same( 2, count( $response->get_data()) );418 $this->assertCount( 2, $response->get_data() ); 419 419 $request = new WP_REST_Request( 'GET', '/wp/v2/media' ); 420 420 // Attachments without a parent. … … 422 422 $response = rest_get_server()->dispatch( $request ); 423 423 $data = $response->get_data(); 424 $this->assert Same( 1, count( $data ));424 $this->assertCount( 1, $data ); 425 425 $this->assertSame( $attachment_id2, $data[0]['id'] ); 426 426 // Attachments with parent=post_id. … … 429 429 $response = rest_get_server()->dispatch( $request ); 430 430 $data = $response->get_data(); 431 $this->assert Same( 1, count( $data ));431 $this->assertCount( 1, $data ); 432 432 $this->assertSame( $attachment_id, $data[0]['id'] ); 433 433 // Attachments with invalid parent. … … 436 436 $response = rest_get_server()->dispatch( $request ); 437 437 $data = $response->get_data(); 438 $this->assert Same( 0, count( $data ));438 $this->assertCount( 0, $data ); 439 439 } 440 440 … … 510 510 $this->assertSame( 200, $response->get_status() ); 511 511 $data = $response->get_data(); 512 $this->assert Same( 2, count( $data ));512 $this->assertCount( 2, $data ); 513 513 $ids = array( 514 514 $data[0]['id'], … … 1466 1466 $data = $response->get_data(); 1467 1467 $properties = $data['schema']['properties']; 1468 $this->assert Same( 27, count( $properties ));1468 $this->assertCount( 27, $properties ); 1469 1469 $this->assertArrayHasKey( 'author', $properties ); 1470 1470 $this->assertArrayHasKey( 'alt_text', $properties );
Note: See TracChangeset
for help on using the changeset viewer.