Make WordPress Core

Changeset 49018


Ignore:
Timestamp:
09/20/2020 02:13:04 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Correctly unset non-supported image editor engines in some image tests.

Follow-up to [49009], [49014].

See #50639, #50640.

File:
1 edited

Legend:

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

    r49015 r49018  
    158158        $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    159159
    160         foreach ( $classes as $class ) {
     160        foreach ( $classes as $key => $class ) {
    161161            if ( ! call_user_func( array( $class, 'test' ) ) ) {
    162162                // If the image editor isn't available, skip it.
    163                 unset( $classes[ $class ] );
     163                unset( $classes[ $key ] );
    164164            }
    165165        }
     
    217217        $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    218218
    219         foreach ( $classes as $class ) {
     219        foreach ( $classes as $key => $class ) {
    220220            if ( ! call_user_func( array( $class, 'test' ) ) ) {
    221221                // If the image editor isn't available, skip it.
    222                 unset( $classes[ $class ] );
     222                unset( $classes[ $key ] );
    223223            }
    224224        }
     
    262262        $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    263263
    264         foreach ( $classes as $class ) {
     264        foreach ( $classes as $key => $class ) {
    265265            if ( ! call_user_func( array( $class, 'test' ) ) ) {
    266266                // If the image editor isn't available, skip it.
    267                 unset( $classes[ $class ] );
     267                unset( $classes[ $key ] );
    268268            }
    269269        }
     
    328328        $classes = array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    329329
    330         foreach ( $classes as $class ) {
     330        foreach ( $classes as $key => $class ) {
    331331            if ( ! call_user_func( array( $class, 'test' ) ) ) {
    332332                // If the image editor isn't available, skip it.
    333                 unset( $classes[ $class ] );
     333                unset( $classes[ $key ] );
    334334            }
    335335        }
Note: See TracChangeset for help on using the changeset viewer.