Ticket #26155: 26155.2.patch
File 26155.2.patch, 1.6 KB (added by , 12 years ago) |
---|
-
tests/phpunit/tests/image/functions.php
30 30 if ( extension_loaded( 'fileinfo' ) ) { 31 31 $finfo = new finfo(); 32 32 $mime_type = $finfo->file( $filename, FILEINFO_MIME ); 33 } elseif ( function_exists( 'mime_content_type') ) {33 } elseif ( function_exists( 'mime_content_type' ) ) { 34 34 $mime_type = mime_content_type( $filename ); 35 35 } 36 36 if ( false !== strpos( $mime_type, ';' ) ) { … … 112 112 * @ticket 6821 113 113 */ 114 114 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 115 119 include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); 116 120 117 121 // Mime types … … 156 160 * @ticket 6821 157 161 */ 158 162 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 } 159 166 160 167 // Test each image editor engine 161 168 $classes = array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick'); … … 191 198 * @ticket 6821 192 199 */ 193 200 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 } 194 204 195 205 // Mime types 196 206 $mime_types = array(