Make WordPress Core


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (2 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-attachments-controller.php

    r52068 r52389  
    523523    public function test_get_items_invalid_date() {
    524524        $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
    525         $request->set_param( 'after', rand_str() );
    526         $request->set_param( 'before', rand_str() );
     525        $request->set_param( 'after', 'foo' );
     526        $request->set_param( 'before', 'bar' );
    527527        $response = rest_get_server()->dispatch( $request );
    528528        $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
     
    571571    public function test_get_items_invalid_modified_date() {
    572572        $request = new WP_REST_Request( 'GET', '/wp/v2/media' );
    573         $request->set_param( 'modified_after', rand_str() );
    574         $request->set_param( 'modified_before', rand_str() );
     573        $request->set_param( 'modified_after', 'foo' );
     574        $request->set_param( 'modified_before', 'bar' );
    575575        $response = rest_get_server()->dispatch( $request );
    576576        $this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
Note: See TracChangeset for help on using the changeset viewer.