From 8856579610e415155f640709e2653e5cff4acbdc Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 20 Sep 2020 14:13:04 +0000 Subject: [PATCH] Tests: Correctly unset non-supported image editor engines in some image tests. Follow-up to [49009], [49014]. See #50639, #50640. git-svn-id: https://develop.svn.wordpress.org/trunk@49018 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/image/functions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 72de73cb67..eed4aa9f2e 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -157,10 +157,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); - foreach ( $classes as $class ) { + foreach ( $classes as $key => $class ) { if ( ! call_user_func( array( $class, 'test' ) ) ) { // If the image editor isn't available, skip it. - unset( $classes[ $class ] ); + unset( $classes[ $key ] ); } } @@ -216,10 +216,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); - foreach ( $classes as $class ) { + foreach ( $classes as $key => $class ) { if ( ! call_user_func( array( $class, 'test' ) ) ) { // If the image editor isn't available, skip it. - unset( $classes[ $class ] ); + unset( $classes[ $key ] ); } } @@ -261,10 +261,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); - foreach ( $classes as $class ) { + foreach ( $classes as $key => $class ) { if ( ! call_user_func( array( $class, 'test' ) ) ) { // If the image editor isn't available, skip it. - unset( $classes[ $class ] ); + unset( $classes[ $key ] ); } } @@ -327,10 +327,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); - foreach ( $classes as $class ) { + foreach ( $classes as $key => $class ) { if ( ! call_user_func( array( $class, 'test' ) ) ) { // If the image editor isn't available, skip it. - unset( $classes[ $class ] ); + unset( $classes[ $key ] ); } }