Make WordPress Core

Changeset 43340


Ignore:
Timestamp:
06/11/2018 05:54:19 PM (6 years ago)
Author:
flixos90
Message:

REST API: Improve test coverage by providing tests for term meta.

See #38323.

Location:
trunk/tests/phpunit/tests/rest-api
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php

    r42724 r43340  
    1515
    1616    public static function wpSetUpBeforeClass( $factory ) {
    17         self::$wp_meta_keys_saved = $GLOBALS['wp_meta_keys'];
     17        self::$wp_meta_keys_saved = isset( $GLOBALS['wp_meta_keys'] ) ? $GLOBALS['wp_meta_keys'] : array();
    1818        self::$post_id            = $factory->post->create();
    1919    }
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r43087 r43340  
    885885    public function test_get_user_invalid_id() {
    886886        wp_set_current_user( self::$user );
    887         $request  = new WP_REST_Request( 'GET', '/wp/v2/users/100' );
     887        $request  = new WP_REST_Request( 'GET', '/wp/v2/users/7777' );
    888888        $response = rest_get_server()->dispatch( $request );
    889889
     
    22492249        wp_set_current_user( self::$user );
    22502250
    2251         $request          = new WP_REST_Request( 'DELETE', '/wp/v2/users/100' );
     2251        $request          = new WP_REST_Request( 'DELETE', '/wp/v2/users/7777' );
    22522252        $request['force'] = true;
    22532253        $request->set_param( 'reassign', false );
     
    23012301        $request          = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/users/%d', $user_id ) );
    23022302        $request['force'] = true;
    2303         $request->set_param( 'reassign', 100 );
     2303        $request->set_param( 'reassign', 7777 );
    23042304        $response = rest_get_server()->dispatch( $request );
    23052305
Note: See TracChangeset for help on using the changeset viewer.