- 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-pages-controller.php
r50463 r51367 110 110 $response = rest_get_server()->dispatch( $request ); 111 111 $data = $response->get_data(); 112 $this->assert Same( 1, count( $data ));112 $this->assertCount( 1, $data ); 113 113 $this->assertSame( $id1, $data[0]['id'] ); 114 114 } … … 133 133 $response = rest_get_server()->dispatch( $request ); 134 134 $data = $response->get_data(); 135 $this->assert Same( 2, count( $data ));135 $this->assertCount( 2, $data ); 136 136 137 137 // Filter to parent. … … 139 139 $response = rest_get_server()->dispatch( $request ); 140 140 $data = $response->get_data(); 141 $this->assert Same( 1, count( $data ));141 $this->assertCount( 1, $data ); 142 142 $this->assertSame( $id2, $data[0]['id'] ); 143 143 … … 180 180 $response = rest_get_server()->dispatch( $request ); 181 181 $data = $response->get_data(); 182 $this->assert Same( 4, count( $data ));182 $this->assertCount( 4, $data ); 183 183 184 184 // Filter to parents. … … 186 186 $response = rest_get_server()->dispatch( $request ); 187 187 $data = $response->get_data(); 188 $this->assert Same( 2, count( $data ));188 $this->assertCount( 2, $data ); 189 189 $this->assertSameSets( array( $id2, $id4 ), wp_list_pluck( $data, 'id' ) ); 190 190 } … … 209 209 $response = rest_get_server()->dispatch( $request ); 210 210 $data = $response->get_data(); 211 $this->assert Same( 2, count( $data ));211 $this->assertCount( 2, $data ); 212 212 213 213 // Filter to parent. … … 215 215 $response = rest_get_server()->dispatch( $request ); 216 216 $data = $response->get_data(); 217 $this->assert Same( 1, count( $data ));217 $this->assertCount( 1, $data ); 218 218 $this->assertSame( $id1, $data[0]['id'] ); 219 219 … … 559 559 560 560 $all_data = $response->get_data(); 561 $this->assert Same( 4, count( $all_data ));561 $this->assertCount( 4, $all_data ); 562 562 foreach ( $all_data as $post ) { 563 563 $this->assertSame( 'page', $post['type'] ); … … 738 738 $data = $response->get_data(); 739 739 $properties = $data['schema']['properties']; 740 $this->assert Same( 24, count( $properties ));740 $this->assertCount( 24, $properties ); 741 741 $this->assertArrayHasKey( 'author', $properties ); 742 742 $this->assertArrayHasKey( 'comment_status', $properties );
Note: See TracChangeset
for help on using the changeset viewer.