Make WordPress Core

Ticket #26155: ticket-26155-php52-mime.patch

File ticket-26155-php52-mime.patch, 1.7 KB (added by bpetty, 10 years ago)
  • tests/phpunit/tests/image/functions.php

    diff --git tests/phpunit/tests/image/functions.php tests/phpunit/tests/image/functions.php
    index e149a32..9d7b475 100644
    class Tests_Image_Functions extends WP_UnitTestCase { 
    3030                if ( extension_loaded( 'fileinfo' ) ) {
    3131                        $finfo = new finfo();
    3232                        $mime_type = $finfo->file( $filename, FILEINFO_MIME );
    33                 } elseif ( function_exists( 'mime_content_type' ) ) {
    34                         $mime_type = mime_content_type( $filename );
    3533                }
    3634                if ( false !== strpos( $mime_type, ';' ) ) {
    3735                        list( $mime_type, $charset ) = explode( ';', $mime_type, 2 );
    class Tests_Image_Functions extends WP_UnitTestCase { 
    112110         * @ticket 6821
    113111         */
    114112        public function test_wp_save_image_file() {
    115                 if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     113                if ( ! extension_loaded( 'fileinfo' ) ) {
    116114                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
    117115                }
    118116
    class Tests_Image_Functions extends WP_UnitTestCase { 
    160158         * @ticket 6821
    161159         */
    162160        public function test_mime_overrides_filename() {
    163                 if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     161                if ( ! extension_loaded( 'fileinfo' ) ) {
    164162                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
    165163                }
    166164
    class Tests_Image_Functions extends WP_UnitTestCase { 
    198196         * @ticket 6821
    199197         */
    200198        public function test_inferred_mime_types() {
    201                 if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     199                if ( ! extension_loaded( 'fileinfo' ) ) {
    202200                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
    203201                }
    204202