Changeset 59985
- Timestamp:
- 03/15/2025 11:26:50 PM (2 months ago)
- Location:
- trunk/tests/phpunit/tests/rest-api
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-global-styles-revisions-controller.php
r59979 r59985 959 959 $request->set_param( 'per_page', 1 ); 960 960 $response = rest_get_server()->dispatch( $request ); 961 $this->assert Equals( 200, $response->get_status() );961 $this->assertSame( 200, $response->get_status() ); 962 962 $data = $response->get_data(); 963 963 $this->assertCount( 1, $data ); 964 $this->assert Equals( 3, $response->get_headers()['X-WP-Total'] );965 $this->assert Equals( 3, $response->get_headers()['X-WP-TotalPages'] );964 $this->assertSame( 3, $response->get_headers()['X-WP-Total'] ); 965 $this->assertSame( 3, $response->get_headers()['X-WP-TotalPages'] ); 966 966 967 967 // Test paged. … … 970 970 $request->set_param( 'per_page', 2 ); 971 971 $response = rest_get_server()->dispatch( $request ); 972 $this->assert Equals( 200, $response->get_status() );972 $this->assertSame( 200, $response->get_status() ); 973 973 $data = $response->get_data(); 974 974 $this->assertCount( 1, $data ); 975 $this->assert Equals( 3, $response->get_headers()['X-WP-Total'] );976 $this->assert Equals( 2, $response->get_headers()['X-WP-TotalPages'] );975 $this->assertSame( 3, $response->get_headers()['X-WP-Total'] ); 976 $this->assertSame( 2, $response->get_headers()['X-WP-TotalPages'] ); 977 977 978 978 // Test out of bounds. -
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. -
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r59979 r59985 1058 1058 $request->set_param( 'per_page', 1 ); 1059 1059 $response = rest_get_server()->dispatch( $request ); 1060 $this->assert Equals( 200, $response->get_status() );1060 $this->assertSame( 200, $response->get_status() ); 1061 1061 $data = $response->get_data(); 1062 1062 $this->assertCount( 1, $data ); 1063 $this->assert Equals( $this->total_revisions, $response->get_headers()['X-WP-Total'] );1064 $this->assert Equals( $this->total_revisions, $response->get_headers()['X-WP-TotalPages'] );1063 $this->assertSame( $this->total_revisions, $response->get_headers()['X-WP-Total'] ); 1064 $this->assertSame( $this->total_revisions, $response->get_headers()['X-WP-TotalPages'] ); 1065 1065 1066 1066 // Test paged. … … 1069 1069 $request->set_param( 'per_page', 2 ); 1070 1070 $response = rest_get_server()->dispatch( $request ); 1071 $this->assert Equals( 200, $response->get_status() );1071 $this->assertSame( 200, $response->get_status() ); 1072 1072 $data = $response->get_data(); 1073 1073 $this->assertCount( 1, $data ); 1074 $this->assert Equals( $this->total_revisions, $response->get_headers()['X-WP-Total'] );1075 $this->assert Equals( (int) ceil( $this->total_revisions / 2 ), $response->get_headers()['X-WP-TotalPages'] );1074 $this->assertSame( $this->total_revisions, $response->get_headers()['X-WP-Total'] ); 1075 $this->assertSame( (int) ceil( $this->total_revisions / 2 ), $response->get_headers()['X-WP-TotalPages'] ); 1076 1076 1077 1077 // Test out of bounds. -
trunk/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php
r59979 r59985 1197 1197 $request->set_param( 'per_page', 1 ); 1198 1198 $response = rest_get_server()->dispatch( $request ); 1199 $this->assert Equals( 200, $response->get_status() );1199 $this->assertSame( 200, $response->get_status() ); 1200 1200 $data = $response->get_data(); 1201 1201 $this->assertCount( 1, $data ); 1202 $this->assert Equals( 4, $response->get_headers()['X-WP-Total'] );1203 $this->assert Equals( 4, $response->get_headers()['X-WP-TotalPages'] );1202 $this->assertSame( 4, $response->get_headers()['X-WP-Total'] ); 1203 $this->assertSame( 4, $response->get_headers()['X-WP-TotalPages'] ); 1204 1204 1205 1205 // Test paged. … … 1208 1208 $request->set_param( 'per_page', 2 ); 1209 1209 $response = rest_get_server()->dispatch( $request ); 1210 $this->assert Equals( 200, $response->get_status() );1210 $this->assertSame( 200, $response->get_status() ); 1211 1211 $data = $response->get_data(); 1212 1212 $this->assertCount( 2, $data ); 1213 $this->assert Equals( 4, $response->get_headers()['X-WP-Total'] );1214 $this->assert Equals( 2, $response->get_headers()['X-WP-TotalPages'] );1213 $this->assertSame( 4, $response->get_headers()['X-WP-Total'] ); 1214 $this->assertSame( 2, $response->get_headers()['X-WP-TotalPages'] ); 1215 1215 1216 1216 // Test out of bounds.
Note: See TracChangeset
for help on using the changeset viewer.