From 48070a45a9368d81c8e7686729a7ea0c02a810bf Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 28 Jan 2019 16:53:14 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/rest-api/rest-schema-sanitization.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php index 6dc08644d5..4f9f2c9242 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php +++ b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php @@ -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 ) ); }