WordPress.org

Make WordPress Core

Changeset 49015


Ignore:
Timestamp:
09/20/2020 01:31:08 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use more specific assertions in Tests_Image_Functions::test_load_directory().

This avoids an error on PHP 8 caused by calling get_resource_type() on a string.

See #50913.

File:
1 edited

Legend:

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

    r49014 r49015  
    321321        // First, test with deprecated wp_load_image function.
    322322        $editor1 = wp_load_image( DIR_TESTDATA );
    323         $this->assertNotInternalType( 'resource', $editor1 );
     323        $this->assertInternalType( 'string', $editor1 );
    324324
    325325        $editor2 = wp_get_image_editor( DIR_TESTDATA );
    326         $this->assertNotInternalType( 'resource', $editor2 );
     326        $this->assertInstanceOf( 'WP_Error', $editor2 );
    327327
    328328        $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
Note: See TracChangeset for help on using the changeset viewer.