Changeset 57524 for trunk/tests/phpunit/tests/image/resize.php
- Timestamp:
- 02/02/2024 05:46:50 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/resize.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/resize.php
r54226 r57524 89 89 } 90 90 91 /** 92 * Test resizing AVIF image. 93 * 94 * @ticket 51228 95 */ 96 public function test_resize_avif() { 97 $file = DIR_TESTDATA . '/images/avif-lossy.avif'; 98 $editor = wp_get_image_editor( $file ); 99 100 // Check if the editor supports the avif mime type. 101 if ( is_wp_error( $editor ) || ! $editor->supports_mime_type( 'image/avif' ) ) { 102 $this->markTestSkipped( sprintf( 'No AVIF support in the editor engine %s on this system.', $this->editor_engine ) ); 103 } 104 105 $image = $this->resize_helper( $file, 25, 25 ); 106 107 list( $w, $h, $type ) = wp_getimagesize( $image ); 108 109 unlink( $image ); 110 111 $this->assertSame( 'avif-lossy-25x25.avif', wp_basename( $image ) ); 112 $this->assertSame( 25, $w ); 113 $this->assertSame( 25, $h ); 114 $this->assertSame( IMAGETYPE_AVIF, $type ); 115 } 116 91 117 public function test_resize_larger() { 92 118 // image_resize() should refuse to make an image larger.
Note: See TracChangeset
for help on using the changeset viewer.