- Timestamp:
- 03/15/2025 11:26:50 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r59979 r59985 5945 5945 $request->set_param( 'per_page', 1 ); 5946 5946 $response = rest_get_server()->dispatch( $request ); 5947 $this->assert Equals( 200, $response->get_status() );5947 $this->assertSame( 200, $response->get_status() ); 5948 5948 $data = $response->get_data(); 5949 5949 $this->assertCount( 1, $data ); 5950 $this->assert Equals( 30, $response->get_headers()['X-WP-Total'] );5951 $this->assert Equals( 30, $response->get_headers()['X-WP-TotalPages'] );5950 $this->assertSame( 30, $response->get_headers()['X-WP-Total'] ); 5951 $this->assertSame( 30, $response->get_headers()['X-WP-TotalPages'] ); 5952 5952 5953 5953 // Test paged. … … 5956 5956 $request->set_param( 'per_page', 2 ); 5957 5957 $response = rest_get_server()->dispatch( $request ); 5958 $this->assert Equals( 200, $response->get_status() );5958 $this->assertSame( 200, $response->get_status() ); 5959 5959 $data = $response->get_data(); 5960 5960 $this->assertCount( 2, $data ); 5961 $this->assert Equals( 30, $response->get_headers()['X-WP-Total'] );5962 $this->assert Equals( 15, $response->get_headers()['X-WP-TotalPages'] );5961 $this->assertSame( 30, $response->get_headers()['X-WP-Total'] ); 5962 $this->assertSame( 15, $response->get_headers()['X-WP-TotalPages'] ); 5963 5963 5964 5964 // Test out of bounds.
Note: See TracChangeset
for help on using the changeset viewer.