Changeset 59145 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 09/30/2024 11:54:49 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r59118 r59145 6104 6104 } 6105 6105 6106 6107 /** 6108 * Test WebP lossless quality is handled correctly. 6109 * 6110 * @ticket 60291 6111 */ 6112 public function test_set_quality_webp_lossless() { 6113 // Get a new editor to test that lossless WebP images are handled correctly. 6114 $editor = wp_get_image_editor( DIR_TESTDATA . '/images/webp-lossless.webp' ); 6115 6116 // If no editor is available, skip the test. 6117 if ( is_wp_error( $editor ) ) { 6118 $this->markTestSkipped( 'No editor available for lossless WebP images.' ); 6119 } 6120 6121 // Only test on GD when WebP lossless is supported. 6122 if ( 'WP_Image_Editor_GD' === get_class( $editor ) && ! defined( 'IMG_WEBP_LOSSLESS' ) ) { 6123 $this->markTestSkipped( 'No GD support available for lossless WebP images.' ); 6124 } 6125 6126 // Verify lossless quality is set correctly: IMG_WEBP_LOSSLESS for GD and 100 for Imagick. 6127 if ( 'WP_Image_Editor_GD' === get_class( $editor ) ) { 6128 $this->assertSame( IMG_WEBP_LOSSLESS, $editor->get_quality() ); 6129 } else { 6130 $this->assertSame( 100, $editor->get_quality() ); 6131 } 6132 } 6133 6106 6134 /** 6107 6135 * Test generated markup for an image with lazy loading gets auto-sizes.
Note: See TracChangeset
for help on using the changeset viewer.