diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php index fdc78ffe3c..4c489140ce 100644 --- a/tests/phpunit/tests/http/base.php +++ b/tests/phpunit/tests/http/base.php @@ -27,7 +27,7 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { $class = 'WP_Http_' . ucfirst( $this->transport ); if ( ! call_user_func( array( $class, 'test' ) ) ) { - $this->markTestSkipped( sprintf( 'The transport %s is not supported on this system', $this->transport ) ); + $this->markTestSkipped( sprintf( 'The transport %s is not supported on this system.', $this->transport ) ); } // Disable all transports aside from this one. diff --git a/tests/phpunit/tests/image/base.php b/tests/phpunit/tests/image/base.php index 8392c548a0..6204709084 100644 --- a/tests/phpunit/tests/image/base.php +++ b/tests/phpunit/tests/image/base.php @@ -12,7 +12,7 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase { parent::setUp(); if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) { - $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system', $this->editor_engine ) ); + $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', $this->editor_engine ) ); } add_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 ); diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 9c81ed6d93..99936c7d00 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -155,6 +155,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); } + if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { + $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); + } + require_once ABSPATH . 'wp-admin/includes/image-edit.php'; // Mime types. @@ -208,6 +212,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); } + if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { + $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); + } + // Test each image editor engine. $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); foreach ( $classes as $class ) { @@ -247,6 +255,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); } + if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { + $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); + } + // Mime types. $mime_types = array( 'jpg' => 'image/jpeg', @@ -307,6 +319,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $editor2 = wp_get_image_editor( DIR_TESTDATA ); $this->assertNotInternalType( 'resource', $editor2 ); + if ( ! WP_Image_Editor_GD::test() && ! WP_Image_Editor_Imagick::test() ) { + $this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', 'WP_Image_Editor_GD' ) ); + } + // Then, test with editors. $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' ); foreach ( $classes as $class ) { @@ -510,7 +526,6 @@ class Tests_Image_Functions extends WP_UnitTestCase { * @ticket 43226 */ public function test_crop_setting_for_pdf() { - if ( ! wp_image_editor_supports( array( 'mime_type' => 'application/pdf' ) ) ) { $this->markTestSkipped( 'Rendering PDFs is not supported on this system.' ); }