Skip to content

Commit

Permalink
Add AVIF to file_is_displayable_image_positive test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilverstein committed Jan 12, 2024
1 parent 306870c commit b50890a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/phpunit/tests/image/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ public function data_file_is_displayable_image_positive() {
$files[] = 'webp-transparent.webp';
}

// Add AVIF images if the image editor supports them.
$file = DIR_TESTDATA . '/images/avif-lossless.avif';
$editor = wp_get_image_editor( $file );

if ( ! is_wp_error( $editor ) && $editor->supports_mime_type( 'image/avif' ) ) {
$files[] = 'avif-animated.avif';
$files[] = 'avif-lossless.avif';
$files[] = 'avif-lossy.avif';
$files[] = 'avif-transparent.avif';
}

return $this->text_array_to_dataprovider( $files );
}

Expand Down

0 comments on commit b50890a

Please sign in to comment.