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
This commit is contained in:
Andrew Nacin 2013-12-05 23:36:50 +00:00
parent a7ee089f6f
commit e159b7b28a
1 changed files with 3 additions and 5 deletions

View File

@ -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.' );
}