Changeset 50810 for trunk/tests/phpunit/tests/image/functions.php
- Timestamp:
- 05/04/2021 02:43:36 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/functions.php
r49450 r50810 60 60 'test-image-zip.tiff', 61 61 'test-image.jpg', 62 'webp-animated.webp', 63 'webp-lossless.webp', 64 'webp-lossy.webp', 65 'webp-transparent.webp', 62 66 ); 63 67 … … 92 96 'test-image.jpg', 93 97 ); 98 99 // Add WebP images if the image editor supports them. 100 $file = DIR_TESTDATA . '/images/test-image.webp'; 101 $editor = wp_get_image_editor( $file ); 102 if ( ( ! is_wp_error( $editor ) ) && $editor->supports_mime_type( 'image/webp' ) ) { 103 $files = array_merge( 104 $files, 105 array( 106 'webp-animated.webp', 107 'webp-lossless.webp', 108 'webp-lossy.webp', 109 'webp-transparent.webp', 110 ) 111 ); 112 } 94 113 95 114 // IMAGETYPE_ICO is only defined in PHP 5.3+. … … 175 194 ); 176 195 196 // Include WebP in tests when platform supports it. 197 if ( function_exists( 'imagewebp' ) ) { 198 array_push( $mime_types, 'image/webp' ); 199 } 200 177 201 // Test each image editor engine. 178 202 foreach ( $classes as $class ) { … … 271 295 'gif' => 'image/gif', 272 296 'png' => 'image/png', 273 'unk' => 'image/jpeg', // Default, unknown. 297 'webp' => 'image/webp', 298 'unk' => 'image/jpeg', // Default, unknown. 274 299 ); 275 300
Note: See TracChangeset
for help on using the changeset viewer.