Make WordPress Core

Changeset 43767


Ignore:
Timestamp:
10/19/2018 11:56:20 AM (6 years ago)
Author:
danielbachhuber
Message:

REST API: Use a truly impossibly high number in User Controller tests.

The 100 number could be valid in certain test run configurations. The REST_TESTS_IMPOSSIBLY_HIGH_NUMBER constant is impossibly high for this very reason.

Fixes #45128.

File:
1 edited

Legend:

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

    r43445 r43767  
    799799    public function test_get_user_invalid_id() {
    800800        wp_set_current_user( self::$user );
    801         $request = new WP_REST_Request( 'GET', '/wp/v2/users/100' );
     801        $request = new WP_REST_Request( 'GET', '/wp/v2/users/' . REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
    802802        $response = $this->server->dispatch( $request );
    803803
     
    20702070        wp_set_current_user( self::$user );
    20712071
    2072         $request = new WP_REST_Request( 'DELETE', '/wp/v2/users/100' );
     2072        $request = new WP_REST_Request( 'DELETE', '/wp/v2/users/' . REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
    20732073        $request['force'] = true;
    20742074        $request->set_param( 'reassign', false );
     
    21202120        $request = new WP_REST_Request( 'DELETE', sprintf( '/wp/v2/users/%d', $user_id ) );
    21212121        $request['force'] = true;
    2122         $request->set_param( 'reassign', 100 );
     2122        $request->set_param( 'reassign', REST_TESTS_IMPOSSIBLY_HIGH_NUMBER );
    21232123        $response = $this->server->dispatch( $request );
    21242124
Note: See TracChangeset for help on using the changeset viewer.