Make WordPress Core


Ignore:
Timestamp:
05/05/2021 05:06:17 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/image/functions.php

    r50810 r50814  
    100100        $file   = DIR_TESTDATA . '/images/test-image.webp';
    101101        $editor = wp_get_image_editor( $file );
    102         if ( ( ! is_wp_error( $editor ) ) && $editor->supports_mime_type( 'image/webp' ) ) {
     102
     103        if ( ! is_wp_error( $editor ) && $editor->supports_mime_type( 'image/webp' ) ) {
    103104            $files = array_merge(
    104105                $files,
Note: See TracChangeset for help on using the changeset viewer.