Make WordPress Core

Changeset 55118


Ignore:
Timestamp:
01/23/2023 04:01:07 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use wp_recursive_ksort() in WP_Theme_JSON_Resolver tests.

This replaces a helper method in Tests_Theme_wpThemeJsonResolver with the wp_recursive_ksort() function that was introduced later for the same purpose.

Follow-up to [52049], [53129], [55117].

See #56793.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php

    r55086 r55118  
    474474
    475475    /**
    476      * Recursively applies ksort to an array.
    477      */
    478     private static function recursive_ksort( &$array ) {
    479         foreach ( $array as &$value ) {
    480             if ( is_array( $value ) ) {
    481                 self::recursive_ksort( $value );
    482             }
    483         }
    484         ksort( $array );
    485     }
    486 
    487     /**
    488476     * @ticket 54336
    489477     * @ticket 56611
     
    583571            ),
    584572        );
    585         self::recursive_ksort( $actual_settings );
    586         self::recursive_ksort( $expected_settings );
     573        wp_recursive_ksort( $actual_settings );
     574        wp_recursive_ksort( $expected_settings );
    587575
    588576        // Should merge settings.
Note: See TracChangeset for help on using the changeset viewer.