Make WordPress Core

Changeset 26705


Ignore:
Timestamp:
12/05/2013 11:36:50 PM (10 years ago)
Author:
nacin
Message:

Unit Tests: Avoid using mime_content_type() as it fails miserably in PHP 5.2.

props bpetty.
fixes #26155.

File:
1 edited

Legend:

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

    r26318 r26705  
    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, ';' ) ) {
     
    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        }
     
    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        }
     
    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        }
Note: See TracChangeset for help on using the changeset viewer.