WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/22/2015 09:06:36 PM (7 years ago)
Author:
boonebgorges
Message:

Better image-type support checks in image unit tests.

PHP can be compiled without support for certain image types. Our unit tests
should be sensitive to these configurations.

Fixes #31124.

File:
1 edited

Legend:

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

    r31259 r31510  
    138138            // Save a file as each mime type, assert it works
    139139            foreach ( $mime_types as $mime_type ) {
     140                if ( ! $class::supports_mime_type( $mime_type ) ) {
     141                    continue;
     142                }
     143
    140144                $file = wp_tempnam();
    141145                $ret = wp_save_image_file( $file, $img, $mime_type, 1 );
     
    229233            $temp = get_temp_dir();
    230234            foreach ( $mime_types as $ext => $mime_type ) {
     235                if ( ! $class::supports_mime_type( $mime_type ) ) {
     236                    continue;
     237                }
     238
    231239                $file = wp_unique_filename( $temp, uniqid() . ".$ext" );
    232240                $ret = $img->save( trailingslashit( $temp ) . $file );
Note: See TracChangeset for help on using the changeset viewer.