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/functions.php

    r50810 r50814  
    12411241        if ( is_array( $expected ) ) {
    12421242            foreach ( $expected as $k => $v ) {
    1243                 $this->assertEquals( true, isset( $result[ $k ] ) );
    1244                 $this->assertEquals( $expected[ $k ], $result[ $k ] );
     1243                $this->assertArrayHasKey( $k, $result );
     1244                $this->assertSame( $expected[ $k ], $result[ $k ] );
    12451245            }
    12461246        } else {
    1247             $this->assertEquals( $expected, $result );
     1247            $this->assertSame( $expected, $result );
    12481248        }
    12491249    }
     
    13131313
    13141314    /**
    1315      * Data provider for test_wp_get_image_mime();
     1315     * Data provider for test_wp_get_image_mime().
    13161316     */
    13171317    public function _wp_get_image_mime() {
     
    13681368
    13691369    /**
    1370      * Data profider for test_wp_getimagesize();
     1370     * Data profider for test_wp_getimagesize().
    13711371     */
    13721372    public function data_wp_getimagesize() {
Note: See TracChangeset for help on using the changeset viewer.