Make WordPress Core

Changeset 26318


Ignore:
Timestamp:
11/22/2013 05:37:35 AM (13 years ago)
Author:
SergeyBiryukov
Message:

Skip image mime type tests if both fileinfo PHP extension and mime_content_type() function are missing.

fixes #26155.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/functions.php

    r25409 r26318  
    3131                        $finfo = new finfo();
    3232                        $mime_type = $finfo->file( $filename, FILEINFO_MIME );
    33                 } elseif ( function_exists('mime_content_type') ) {
     33                } elseif ( function_exists( 'mime_content_type' ) ) {
    3434                        $mime_type = mime_content_type( $filename );
    3535                }
    … …  
    113113         */
    114114        public function test_wp_save_image_file() {
     115                if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     116                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
     117                }
     118
    115119                include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
    116120
    … …  
    157161         */
    158162        public function test_mime_overrides_filename() {
     163                if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     164                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
     165                }
    159166
    160167                // Test each image editor engine
    … …  
    192199         */
    193200        public function test_inferred_mime_types() {
     201                if ( ! extension_loaded( 'fileinfo' ) && ! function_exists( 'mime_content_type' ) ) {
     202                        $this->markTestSkipped( 'The fileinfo PHP extension is not loaded.' );
     203                }
    194204
    195205                // Mime types
Note: See TracChangeset for help on using the changeset viewer.