From 1433b636d1378929871e1169b848b52e5d43a7c8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 23 Jan 2023 16:01:07 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@55118 602fd350-edb4-49c9-b593-d223f7449a82 --- .../phpunit/tests/theme/wpThemeJsonResolver.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/tests/theme/wpThemeJsonResolver.php b/tests/phpunit/tests/theme/wpThemeJsonResolver.php index 7db984e941..a835b0a3ff 100644 --- a/tests/phpunit/tests/theme/wpThemeJsonResolver.php +++ b/tests/phpunit/tests/theme/wpThemeJsonResolver.php @@ -472,18 +472,6 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { $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 @@ -582,8 +570,8 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { ), ), ); - 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(