- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php
r47122 r48937 23 23 $response = rest_get_server()->dispatch( $request ); 24 24 $data = $response->get_data(); 25 $this->assert Equals( 'view', $data['endpoints'][0]['args']['context']['default'] );25 $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); 26 26 $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); 27 27 // Single. … … 29 29 $response = rest_get_server()->dispatch( $request ); 30 30 $data = $response->get_data(); 31 $this->assert Equals( 'view', $data['endpoints'][0]['args']['context']['default'] );31 $this->assertSame( 'view', $data['endpoints'][0]['args']['context']['default'] ); 32 32 $this->assertEqualSets( array( 'embed', 'view', 'edit' ), $data['endpoints'][0]['args']['context']['enum'] ); 33 33 } … … 39 39 $data = $response->get_data(); 40 40 $statuses = get_post_stati( array( 'public' => true ), 'objects' ); 41 $this->assert Equals( 1, count( $data ) );42 $this->assert Equals( 'publish', $data['publish']['slug'] );41 $this->assertSame( 1, count( $data ) ); 42 $this->assertSame( 'publish', $data['publish']['slug'] ); 43 43 } 44 44 … … 51 51 52 52 $data = $response->get_data(); 53 $this->assert Equals( 6, count( $data ) );53 $this->assertSame( 6, count( $data ) ); 54 54 $this->assertEqualSets( 55 55 array( … … 107 107 $request = new WP_REST_Request( 'POST', '/wp/v2/statuses' ); 108 108 $response = rest_get_server()->dispatch( $request ); 109 $this->assert Equals( 404, $response->get_status() );109 $this->assertSame( 404, $response->get_status() ); 110 110 } 111 111 … … 114 114 $request = new WP_REST_Request( 'POST', '/wp/v2/statuses/draft' ); 115 115 $response = rest_get_server()->dispatch( $request ); 116 $this->assert Equals( 404, $response->get_status() );116 $this->assertSame( 404, $response->get_status() ); 117 117 } 118 118 … … 121 121 $request = new WP_REST_Request( 'DELETE', '/wp/v2/statuses/draft' ); 122 122 $response = rest_get_server()->dispatch( $request ); 123 $this->assert Equals( 404, $response->get_status() );123 $this->assertSame( 404, $response->get_status() ); 124 124 } 125 125 … … 140 140 $request->set_param( '_fields', 'id,name' ); 141 141 $response = $endpoint->prepare_item_for_response( $obj, $request ); 142 $this->assert Equals(142 $this->assertSame( 143 143 array( 144 144 // 'id' doesn't exist in this context. … … 154 154 $data = $response->get_data(); 155 155 $properties = $data['schema']['properties']; 156 $this->assert Equals( 8, count( $properties ) );156 $this->assertSame( 8, count( $properties ) ); 157 157 $this->assertArrayHasKey( 'name', $properties ); 158 158 $this->assertArrayHasKey( 'private', $properties ); … … 190 190 191 191 $this->assertArrayHasKey( 'my_custom_int', $data['schema']['properties'] ); 192 $this->assert Equals( $schema, $data['schema']['properties']['my_custom_int'] );192 $this->assertSame( $schema, $data['schema']['properties']['my_custom_int'] ); 193 193 194 194 $request = new WP_REST_Request( 'GET', '/wp/v2/statuses/publish' ); … … 206 206 207 207 protected function check_post_status_obj( $status_obj, $data, $links ) { 208 $this->assert Equals( $status_obj->label, $data['name'] );209 $this->assert Equals( $status_obj->private, $data['private'] );210 $this->assert Equals( $status_obj->protected, $data['protected'] );211 $this->assert Equals( $status_obj->public, $data['public'] );212 $this->assert Equals( $status_obj->publicly_queryable, $data['queryable'] );213 $this->assert Equals( $status_obj->show_in_admin_all_list, $data['show_in_list'] );214 $this->assert Equals( $status_obj->name, $data['slug'] );208 $this->assertSame( $status_obj->label, $data['name'] ); 209 $this->assertSame( $status_obj->private, $data['private'] ); 210 $this->assertSame( $status_obj->protected, $data['protected'] ); 211 $this->assertSame( $status_obj->public, $data['public'] ); 212 $this->assertSame( $status_obj->publicly_queryable, $data['queryable'] ); 213 $this->assertSame( $status_obj->show_in_admin_all_list, $data['show_in_list'] ); 214 $this->assertSame( $status_obj->name, $data['slug'] ); 215 215 $this->assertEqualSets( 216 216 array( … … 219 219 array_keys( $links ) 220 220 ); 221 $this->assert Equals( $status_obj->date_floating, $data['date_floating'] );221 $this->assertSame( $status_obj->date_floating, $data['date_floating'] ); 222 222 } 223 223 224 224 protected function check_post_status_object_response( $response ) { 225 $this->assert Equals( 200, $response->get_status() );225 $this->assertSame( 200, $response->get_status() ); 226 226 $data = $response->get_data(); 227 227 $obj = get_post_status_object( 'publish' );
Note: See TracChangeset
for help on using the changeset viewer.