mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests. Props johnillo Fixes #37371 git-svn-id: https://develop.svn.wordpress.org/trunk@52389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -522,8 +522,8 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
|
||||
|
||||
public function test_get_items_invalid_date() {
|
||||
$request = new WP_REST_Request( 'GET', '/wp/v2/media' );
|
||||
$request->set_param( 'after', rand_str() );
|
||||
$request->set_param( 'before', rand_str() );
|
||||
$request->set_param( 'after', 'foo' );
|
||||
$request->set_param( 'before', 'bar' );
|
||||
$response = rest_get_server()->dispatch( $request );
|
||||
$this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
|
||||
}
|
||||
@@ -570,8 +570,8 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
|
||||
*/
|
||||
public function test_get_items_invalid_modified_date() {
|
||||
$request = new WP_REST_Request( 'GET', '/wp/v2/media' );
|
||||
$request->set_param( 'modified_after', rand_str() );
|
||||
$request->set_param( 'modified_before', rand_str() );
|
||||
$request->set_param( 'modified_after', 'foo' );
|
||||
$request->set_param( 'modified_before', 'bar' );
|
||||
$response = rest_get_server()->dispatch( $request );
|
||||
$this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user