Build/Test Tools: Correct WP_Test_REST_Schema_Sanitization::test_type_string() to check for both 1.1 float and '1.10' string explicitly.

Previously, the test only passed due to a bug in PHPUnit 7.1.x and older versions.

Fixes #43218. See #38586.

git-svn-id: https://develop.svn.wordpress.org/trunk@44703 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-01-28 16:53:14 +00:00
parent 6d8637097a
commit 48070a45a9

View File

@ -38,7 +38,8 @@ class WP_Test_REST_Schema_Sanitization extends WP_UnitTestCase {
'type' => 'string',
);
$this->assertEquals( 'Hello', rest_sanitize_value_from_schema( 'Hello', $schema ) );
$this->assertEquals( '1.10', rest_sanitize_value_from_schema( 1.10, $schema ) );
$this->assertEquals( '1.10', rest_sanitize_value_from_schema( '1.10', $schema ) );
$this->assertEquals( '1.1', rest_sanitize_value_from_schema( 1.1, $schema ) );
$this->assertEquals( '1', rest_sanitize_value_from_schema( 1, $schema ) );
}