Make WordPress Core


Ignore:
Timestamp:
11/29/2022 03:49:49 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Always use parentheses when instantiating an object.

Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php

    r54273 r54891  
    134134    public function test_prepare_item() {
    135135        $obj      = get_post_type_object( 'post' );
    136         $endpoint = new WP_REST_Post_Types_Controller;
    137         $request  = new WP_REST_Request;
     136        $endpoint = new WP_REST_Post_Types_Controller();
     137        $request  = new WP_REST_Request();
    138138        $request->set_param( 'context', 'edit' );
    139139        $response = $endpoint->prepare_item_for_response( $obj, $request );
     
    143143    public function test_prepare_item_limit_fields() {
    144144        $obj      = get_post_type_object( 'post' );
    145         $request  = new WP_REST_Request;
    146         $endpoint = new WP_REST_Post_Types_Controller;
     145        $request  = new WP_REST_Request();
     146        $endpoint = new WP_REST_Post_Types_Controller();
    147147        $request->set_param( 'context', 'edit' );
    148148        $request->set_param( '_fields', 'id,name' );
Note: See TracChangeset for help on using the changeset viewer.