Media: Some documentation and test improvements for WebP support:

* Document that WebP constants are only defined in PHP 7.1+.
* Correct the `$filename` parameter type in `wp_get_webp_info()`.
* Use a consistent message when skipping tests due to the lack of WebP support.
* Remove unnecessary `else` branches after `markTestSkipped()`.
* Replace `assertEquals()` with more appropriate assertions.

Follow-up to [50810].

See #35725.

git-svn-id: https://develop.svn.wordpress.org/trunk@50814 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-05-05 17:06:17 +00:00
parent 596a24c692
commit 462560edba
7 changed files with 38 additions and 28 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ if ( ! function_exists( 'is_iterable' ) ) {
}
}
// WebP constants may not be defined, even in cases where the format is supported.
// WebP constants are only defined in PHP 7.1+.
if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
define( 'IMAGETYPE_WEBP', 18 );
}