- Timestamp:
- 11/29/2022 03:49:49 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-widget-types-controller.php
r54058 r54891 119 119 $data = $response->get_data(); 120 120 $this->assertGreaterThan( 1, count( $data ) ); 121 $endpoint = new WP_REST_Widget_Types_Controller ;121 $endpoint = new WP_REST_Widget_Types_Controller(); 122 122 foreach ( $data as $item ) { 123 123 $widget_type = $endpoint->get_widget( $item['name'] ); … … 181 181 $request = new WP_REST_Request( 'GET', '/wp/v2/widget-types/' . $widget_name ); 182 182 $response = rest_get_server()->dispatch( $request ); 183 $endpoint = new WP_REST_Widget_Types_Controller ;183 $endpoint = new WP_REST_Widget_Types_Controller(); 184 184 $widget_type = $endpoint->get_widget( $widget_name ); 185 185 $this->check_widget_type_object( $widget_type, $response->get_data(), $response->get_links() ); … … 199 199 $request = new WP_REST_Request( 'GET', '/wp/v2/widget-types/' . $widget_id ); 200 200 $response = rest_get_server()->dispatch( $request ); 201 $endpoint = new WP_REST_Widget_Types_Controller ;201 $endpoint = new WP_REST_Widget_Types_Controller(); 202 202 $widget_type = $endpoint->get_widget( $widget_id ); 203 203 $this->check_widget_type_object( $widget_type, $response->get_data(), $response->get_links() ); … … 299 299 */ 300 300 public function test_prepare_item() { 301 $endpoint = new WP_REST_Widget_Types_Controller ;301 $endpoint = new WP_REST_Widget_Types_Controller(); 302 302 $widget_type = $endpoint->get_widget( 'calendar' ); 303 $request = new WP_REST_Request ;303 $request = new WP_REST_Request(); 304 304 $request->set_param( 'context', 'edit' ); 305 305 $response = $endpoint->prepare_item_for_response( $widget_type, $request ); … … 367 367 'encoded' => base64_encode( serialize( array() ) ), 368 368 'hash' => wp_hash( serialize( array() ) ), 369 'raw' => new stdClass ,369 'raw' => new stdClass(), 370 370 ), 371 371 $data['instance'] … … 403 403 'encoded' => base64_encode( serialize( array() ) ), 404 404 'hash' => wp_hash( serialize( array() ) ), 405 'raw' => new stdClass ,405 'raw' => new stdClass(), 406 406 ), 407 407 $data['instance']
Note: See TracChangeset
for help on using the changeset viewer.