mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
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
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user