Make WordPress Core


Ignore:
Timestamp:
02/06/2023 03:31:50 PM (4 years ago)
Author:
jorgefilipecosta
Message:

Block editor: Update WP_Theme_JSON_Resolver and improve its performance.

This commit includes the latest updates WP_Theme_JSON_Resolver class made in the block editor. Some of these updates improve the performance of the class.

Props Mamaduka, hellofromTonya, flixos90, jorgefilipecosta, oandregal, spacedmonkey, audrasjb, costdev, scruffian.
Closes #57545.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php

    r55192 r55231  
    485485                $data     = $response->get_data();
    486486                $expected = array(
     487                        array(
     488                                'version'  => 2,
     489                                'title'    => 'variation-b',
     490                                'settings' => array(
     491                                        'blocks' => array(
     492                                                'core/post-title' => array(
     493                                                        'color' => array(
     494                                                                'palette' => array(
     495                                                                        'theme' => array(
     496                                                                                array(
     497                                                                                        'slug'  => 'light',
     498                                                                                        'name'  => 'Light',
     499                                                                                        'color' => '#f1f1f1',
     500                                                                                ),
     501                                                                        ),
     502                                                                ),
     503                                                        ),
     504                                                ),
     505                                        ),
     506                                ),
     507                        ),
    487508                        array(
    488509                                'version'  => 2,
     
    512533                        ),
    513534                );
    514                 $this->assertSameSetsWithIndex( $data, $expected );
     535
     536                wp_recursive_ksort( $data );
     537                wp_recursive_ksort( $expected );
     538
     539                $this->assertSameSets( $data, $expected );
    515540        }
    516541
Note: See TracChangeset for help on using the changeset viewer.