From e159b7b28a8715c6f496845eb74f2fca3f402f93 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 5 Dec 2013 23:36:50 +0000 Subject: [PATCH] Unit Tests: Avoid using mime_content_type() as it fails miserably in PHP 5.2. props bpetty. fixes #26155. git-svn-id: https://develop.svn.wordpress.org/trunk@26705 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/image/functions.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index e149a324aa..9d7b4758c6 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -30,8 +30,6 @@ class Tests_Image_Functions extends WP_UnitTestCase { if ( extension_loaded( 'fileinfo' ) ) { $finfo = new finfo(); $mime_type = $finfo->file( $filename, FILEINFO_MIME ); - } elseif ( function_exists( 'mime_content_type' ) ) { - $mime_type = mime_content_type( $filename ); } if ( false !== strpos( $mime_type, ';' ) ) { list( $mime_type, $charset ) = explode( ';', $mime_type, 2 ); @@ -112,7 +110,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * @ticket 6821 */ public function test_wp_save_image_file() { - if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) { + if ( ! extension_loaded( 'fileinfo' ) ) { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); } @@ -160,7 +158,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * @ticket 6821 */ public function test_mime_overrides_filename() { - if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) { + if ( ! extension_loaded( 'fileinfo' ) ) { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); } @@ -198,7 +196,7 @@ class Tests_Image_Functions extends WP_UnitTestCase { * @ticket 6821 */ public function test_inferred_mime_types() { - if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) { + if ( ! extension_loaded( 'fileinfo' ) ) { $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' ); }