REST API: Update unit tests to account for the string changes in [39896].

See #39054.

git-svn-id: https://develop.svn.wordpress.org/trunk@39899 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-01-13 05:14:43 +00:00
parent 2f6e33dd2e
commit 287e5501ab
1 changed files with 6 additions and 6 deletions

View File

@ -108,7 +108,7 @@ class WP_Test_REST_Request_Validation extends WP_Test_REST_TestCase {
), ),
) ); ) );
$ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' ); $ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' );
$this->assertEquals( 'greaterthanmin must be greater than 2 (inclusive)', $ret->get_error_message() ); $this->assertEquals( 'greaterthanmin must be greater than or equal to 2', $ret->get_error_message() );
$ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' ); $ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' );
$this->assertTrue( $ret ); $this->assertTrue( $ret );
} }
@ -124,9 +124,9 @@ class WP_Test_REST_Request_Validation extends WP_Test_REST_TestCase {
), ),
) ); ) );
$ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' ); $ret = rest_validate_request_arg( 1, $request, 'greaterthanmin' );
$this->assertEquals( 'greaterthanmin must be greater than 2 (exclusive)', $ret->get_error_message() ); $this->assertEquals( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
$ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' ); $ret = rest_validate_request_arg( 2, $request, 'greaterthanmin' );
$this->assertEquals( 'greaterthanmin must be greater than 2 (exclusive)', $ret->get_error_message() ); $this->assertEquals( 'greaterthanmin must be greater than 2', $ret->get_error_message() );
$ret = rest_validate_request_arg( 3, $request, 'greaterthanmin' ); $ret = rest_validate_request_arg( 3, $request, 'greaterthanmin' );
$this->assertTrue( $ret ); $this->assertTrue( $ret );
} }
@ -141,7 +141,7 @@ class WP_Test_REST_Request_Validation extends WP_Test_REST_TestCase {
), ),
) ); ) );
$ret = rest_validate_request_arg( 11, $request, 'lessthanmax' ); $ret = rest_validate_request_arg( 11, $request, 'lessthanmax' );
$this->assertEquals( 'lessthanmax must be less than 10 (inclusive)', $ret->get_error_message() ); $this->assertEquals( 'lessthanmax must be less than or equal to 10', $ret->get_error_message() );
$ret = rest_validate_request_arg( 10, $request, 'lessthanmax' ); $ret = rest_validate_request_arg( 10, $request, 'lessthanmax' );
$this->assertTrue( $ret ); $this->assertTrue( $ret );
} }
@ -157,9 +157,9 @@ class WP_Test_REST_Request_Validation extends WP_Test_REST_TestCase {
), ),
) ); ) );
$ret = rest_validate_request_arg( 11, $request, 'lessthanmax' ); $ret = rest_validate_request_arg( 11, $request, 'lessthanmax' );
$this->assertEquals( 'lessthanmax must be less than 10 (exclusive)', $ret->get_error_message() ); $this->assertEquals( 'lessthanmax must be less than 10', $ret->get_error_message() );
$ret = rest_validate_request_arg( 10, $request, 'lessthanmax' ); $ret = rest_validate_request_arg( 10, $request, 'lessthanmax' );
$this->assertEquals( 'lessthanmax must be less than 10 (exclusive)', $ret->get_error_message() ); $this->assertEquals( 'lessthanmax must be less than 10', $ret->get_error_message() );
$ret = rest_validate_request_arg( 9, $request, 'lessthanmax' ); $ret = rest_validate_request_arg( 9, $request, 'lessthanmax' );
$this->assertTrue( $ret ); $this->assertTrue( $ret );
} }