From 7f06d496618abec40bc396ae974a0c85f82002d6 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 15 Aug 2020 17:22:19 +0200 Subject: [PATCH] Tests: replace `assert[Not]InternalType( 'float', $var )` with `assertIs[Not]Float()` The `assertInternalType()` and `assertNotInternalType()` methods were soft deprecated in PHPUnit 7.5, hard deprecated in PHPUnit 8.0 and the functionality was removed in PHPUnit 9.0. The more specific `assertIsArray()`, `assertIsNotArray()`, `assertIsBool()`, `assertIsNotBool()`, `assertIsFloat()`, `assertIsNotFloat()`, `assertIsInt()`, `assertIsNotInt()`, `assertIsNumeric()`, `assertIsNotNumeric()`, `assertIsObject()`, `assertIsNotObject()`, `assertIsResource()`, `assertIsNotResource()`, `assertIsString()`, `assertIsNotString()`, `assertIsScalar()`, `assertIsNotScalar()`, `assertIsCallable()`, `assertIsNotCallable()`, `assertIsIterable()`, `assertIsNotIterable()` methods were introduced as replacements in PHPUnit 7.5. Ref: * https://github.com/sebastianbergmann/phpunit/blob/7.5.20/ChangeLog-7.5.md#750---2018-12-07 * https://github.com/sebastianbergmann/phpunit/issues/3368 --- tests/phpunit/tests/rest-api/rest-post-meta-fields.php | 2 +- tests/phpunit/tests/rest-api/rest-term-meta-fields.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php index ae2a13ace6db..0251aee870f8 100644 --- a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php +++ b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php @@ -399,7 +399,7 @@ public function test_get_value_types() { $this->assertSame( '42', $meta['test_string'] ); $this->assertArrayHasKey( 'test_number', $meta ); - $this->assertInternalType( 'float', $meta['test_number'] ); + $this->assertIsFloat( $meta['test_number'] ); $this->assertSame( 42.0, $meta['test_number'] ); $this->assertArrayHasKey( 'test_bool', $meta ); diff --git a/tests/phpunit/tests/rest-api/rest-term-meta-fields.php b/tests/phpunit/tests/rest-api/rest-term-meta-fields.php index c99a9092eef1..7340dd46723f 100644 --- a/tests/phpunit/tests/rest-api/rest-term-meta-fields.php +++ b/tests/phpunit/tests/rest-api/rest-term-meta-fields.php @@ -346,7 +346,7 @@ public function test_get_value_types() { $this->assertSame( '42', $meta['test_string'] ); $this->assertArrayHasKey( 'test_number', $meta ); - $this->assertInternalType( 'float', $meta['test_number'] ); + $this->assertIsFloat( $meta['test_number'] ); $this->assertSame( 42.0, $meta['test_number'] ); $this->assertArrayHasKey( 'test_bool', $meta );