Skip to content

Commit

Permalink
Tests: Use wp_recursive_ksort() in WP_Theme_JSON_Resolver tests.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@55118 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 23, 2023
1 parent 005cfdb commit 1433b63
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/phpunit/tests/theme/wpThemeJsonResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,18 +472,6 @@ public function test_add_theme_supports_are_loaded_for_themes_without_theme_json
$this->assertTrue( $settings['border']['color'], 'Support for appearance-tools was not added.' );
}

/**
* Recursively applies ksort to an array.
*/
private static function recursive_ksort( &$array ) {
foreach ( $array as &$value ) {
if ( is_array( $value ) ) {
self::recursive_ksort( $value );
}
}
ksort( $array );
}

/**
* @ticket 54336
* @ticket 56611
Expand Down Expand Up @@ -582,8 +570,8 @@ public function test_merges_child_theme_json_into_parent_theme_json() {
),
),
);
self::recursive_ksort( $actual_settings );
self::recursive_ksort( $expected_settings );
wp_recursive_ksort( $actual_settings );
wp_recursive_ksort( $expected_settings );

// Should merge settings.
$this->assertSame(
Expand Down

0 comments on commit 1433b63

Please sign in to comment.