WordPress.org

Make WordPress Core

Ticket #38842: 38842.1.diff

File 38842.1.diff, 640 bytes (added by danielbachhuber, 4 years ago)

Assert context=view by default for GET /wp/v2/users/me

  • tests/phpunit/tests/rest-api/rest-users-controller.php

    diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php
    index cd7eb41..8da864f 100644
    a b class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase { 
    678678
    679679                $response = $this->server->dispatch( $request );
    680680                $this->assertEquals( 200, $response->get_status() );
     681                $this->check_get_user_response( $response, 'view' );
    681682
    682683                $headers = $response->get_headers();
    683684                $this->assertArrayNotHasKey( 'Location', $headers );