Changeset 50810 for trunk/tests/phpunit/tests/image/resize.php
- Timestamp:
- 05/04/2021 02:43:36 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/resize.php
r50463 r50810 65 65 } 66 66 67 function test_resize_webp() { 68 $file = DIR_TESTDATA . '/images/test-image.webp'; 69 $editor = wp_get_image_editor( $file ); 70 71 // Check if the editor supports the webp mime type. 72 if ( is_wp_error( $editor ) || ! $editor->supports_mime_type( 'image/webp' ) ) { 73 $this->markTestSkipped( sprintf( 'Skipping test: no WebP support in the editor engine %s on this system.', $this->editor_engine ) ); 74 } else { 75 $image = $this->resize_helper( $file, 25, 25 ); 76 $this->assertSame( 'test-image-25x25.webp', wp_basename( $image ) ); 77 list($w, $h, $type) = wp_getimagesize( $image ); 78 $this->assertSame( 25, $w ); 79 $this->assertSame( 25, $h ); 80 $this->assertSame( IMAGETYPE_WEBP, $type ); 81 unlink( $image ); 82 } 83 } 84 67 85 function test_resize_larger() { 68 86 // image_resize() should refuse to make an image larger.
Note: See TracChangeset
for help on using the changeset viewer.