From f746feb52c199b0383540c4fdc5b83be907a389e Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 15 Aug 2020 17:37:09 +0200 Subject: [PATCH] Tests: replace `assert[Not]InternalType( 'resource', $var )` with `assertIs[Not]Resource()` 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/image/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 721d96a22a6b4..e6c3fff31b16f 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -302,10 +302,10 @@ public function test_load_directory() { // First, test with deprecated wp_load_image function. $editor1 = wp_load_image( DIR_TESTDATA ); - $this->assertNotInternalType( 'resource', $editor1 ); + $this->assertIsNotResource( $editor1 ); $editor2 = wp_get_image_editor( DIR_TESTDATA ); - $this->assertNotInternalType( 'resource', $editor2 ); + $this->assertIsNotResource( $editor2 ); // Then, test with editors. $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );