From e92ddaa2c3036569d71b7696bd69431fec876277 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 20 Sep 2020 13:31:08 +0000 Subject: [PATCH] Tests: Use more specific assertions in `Tests_Image_Functions::test_load_directory()`. This avoids an error on PHP 8 caused by calling `get_resource_type()` on a string. See #50913. git-svn-id: https://develop.svn.wordpress.org/trunk@49015 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 1daf479360..72de73cb67 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -320,10 +320,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { // First, test with deprecated wp_load_image function. $editor1 = wp_load_image( DIR_TESTDATA ); - $this->assertNotInternalType( 'resource', $editor1 ); + $this->assertInternalType( 'string', $editor1 ); $editor2 = wp_get_image_editor( DIR_TESTDATA ); - $this->assertNotInternalType( 'resource', $editor2 ); + $this->assertInstanceOf( 'WP_Error', $editor2 ); $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );