WordPress.org

Make WordPress Core

Changeset 48499


Ignore:
Timestamp:
07/16/2020 10:09:35 PM (4 months ago)
Author:
whyisjake
Message:

Code Formatting: Fix some formatting around WP_REST_Attachments_Controller tests.

See #50565.

File:
1 edited

Legend:

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

    r48498 r48499  
    18011801        $attachment = self::factory()->attachment->create_upload_object( $this->test_file );
    18021802
    1803         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1803        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18041804        $request->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment, 'full' ) ) );
    18051805        $response = rest_do_request( $request );
     
    18171817        $attachment = self::factory()->attachment->create_upload_object( $this->test_file );
    18181818
    1819         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1819        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18201820        $request->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment, 'full' ) ) );
    18211821        $response = rest_do_request( $request );
     
    18301830        $attachment = self::factory()->attachment->create_upload_object( $this->test_file );
    18311831
    1832         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1832        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18331833        $request->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment, 'full' ) ) );
    18341834        $response = rest_do_request( $request );
     
    18431843        $attachment = self::factory()->attachment->create();
    18441844
    1845         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1845        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18461846        $request->set_body_params( array( 'src' => '/wp-content/uploads/2020/07/canola.jpg' ) );
    18471847        $response = rest_do_request( $request );
     
    18621862        );
    18631863
    1864         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1864        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18651865        $request->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment, 'full' ) ) );
    18661866        $response = rest_do_request( $request );
     
    18751875        $attachment = self::factory()->attachment->create_upload_object( $this->test_file );
    18761876
    1877         $request  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
     1877        $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" );
    18781878        $request->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment, 'full' ) ) );
    18791879        $response = rest_do_request( $request );
     
    19801980
    19811981        // Test: attachment ID points to a different, non-image attachment.
    1982         $request_1  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_file}/edit" );
     1982        $request_1 = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_file}/edit" );
    19831983        $request_1->set_body_params( array( 'src' => $image_src ) );
    19841984
     
    19871987
    19881988        // Test: attachment ID points to a different image attachment.
    1989         $request_2  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_image2}/edit" );
     1989        $request_2 = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_image2}/edit" );
    19901990        $request_2->set_body_params( array( 'src' => $image_src ) );
    19911991
     
    19941994
    19951995        // Test: attachment src points to a sub-size of the image.
    1996         $request_3  = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_image1}/edit" );
     1996        $request_3 = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment_id_image1}/edit" );
    19971997        $request_3->set_body_params( array( 'src' => wp_get_attachment_image_url( $attachment_id_image1, 'medium' ) ) );
    19981998
Note: See TracChangeset for help on using the changeset viewer.