WordPress.org

Make WordPress Core

Changeset 39660


Ignore:
Timestamp:
01/02/17 18:42:22 (8 months ago)
Author:
rachelbaker
Message:

REST API: Add missing assertions to the view and embed context response data for the Users Controller.

Adds tests for responses where context != 'edit' the following properties are not included in the response data:

  • email
  • locale
  • registered_date

Props thepelkus, jnylen0.
Fixes #39399.

File:
1 edited

Legend:

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

    r39643 r39660  
    21122112            $this->assertArrayNotHasKey( 'roles', $data ); 
    21132113            $this->assertArrayNotHasKey( 'capabilities', $data ); 
    2114             $this->assertArrayNotHasKey( 'registered', $data ); 
     2114            $this->assertArrayNotHasKey( 'registered_date', $data ); 
    21152115            $this->assertArrayNotHasKey( 'first_name', $data ); 
    21162116            $this->assertArrayNotHasKey( 'last_name', $data ); 
    21172117            $this->assertArrayNotHasKey( 'nickname', $data ); 
     2118            $this->assertArrayNotHasKey( 'email', $data ); 
    21182119            $this->assertArrayNotHasKey( 'extra_capabilities', $data ); 
    21192120            $this->assertArrayNotHasKey( 'username', $data ); 
     2121            $this->assertArrayNotHasKey( 'locale', $data ); 
    21202122        } 
    21212123 
Note: See TracChangeset for help on using the changeset viewer.