Make WordPress Core


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (5 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Reduce the use of unnecessary randomness in tests.

This increases the overall reliability of the tests.

Props johnillo

Fixes #37371

File:
1 edited

Legend:

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

    r52068 r52389  
    331331        public function test_get_items_invalid_date() {
    332332                $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
    333                 $request->set_param( 'after', rand_str() );
    334                 $request->set_param( 'before', rand_str() );
     333                $request->set_param( 'after', 'foo' );
     334                $request->set_param( 'before', 'bar' );
    335335                $response = rest_get_server()->dispatch( $request );
    336336                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    370370        public function test_get_items_invalid_modified_date() {
    371371                $request = new WP_REST_Request( 'GET', '/wp/v2/pages' );
    372                 $request->set_param( 'modified_after', rand_str() );
    373                 $request->set_param( 'modified_before', rand_str() );
     372                $request->set_param( 'modified_after', 'foo' );
     373                $request->set_param( 'modified_before', 'bar' );
    374374                $response = rest_get_server()->dispatch( $request );
    375375                $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
Note: See TracChangeset for help on using the changeset viewer.