-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Backport: WP_Theme_JSON_Resolver changes #3901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1ff63af
f28b16c
91b86d8
f3cc87c
19b6516
d85fa86
0e595e6
8c1d84a
8c1db45
8b5cc6c
9952fa3
3b40b25
8820c62
3a090ec
9870b44
1cc848e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "version": 2, | ||
| "settings": { | ||
| "blocks": { | ||
| "core/post-title": { | ||
| "color": { | ||
| "palette": [ | ||
| { | ||
| "slug": "dark", | ||
| "name": "Dark", | ||
| "color": "#010101" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "version": 2, | ||
| "settings": { | ||
| "blocks": { | ||
| "core/post-title": { | ||
| "color": { | ||
| "palette": [ | ||
| { | ||
| "slug": "light", | ||
| "name": "Light", | ||
| "color": "#f1f1f1" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,4 +124,4 @@ | |
| "area": "header" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -484,6 +484,27 @@ public function test_get_theme_items() { | |
| $response = rest_get_server()->dispatch( $request ); | ||
| $data = $response->get_data(); | ||
| $expected = array( | ||
| array( | ||
| 'version' => 2, | ||
| 'title' => 'variation-b', | ||
| 'settings' => array( | ||
| 'blocks' => array( | ||
| 'core/post-title' => array( | ||
| 'color' => array( | ||
| 'palette' => array( | ||
| 'theme' => array( | ||
| array( | ||
| 'slug' => 'light', | ||
| 'name' => 'Light', | ||
| 'color' => '#f1f1f1', | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| array( | ||
| 'version' => 2, | ||
| 'title' => 'Block theme variation', | ||
|
|
@@ -511,6 +532,10 @@ public function test_get_theme_items() { | |
| ), | ||
| ), | ||
| ); | ||
| $this->assertSameSetsWithIndex( $data, $expected ); | ||
|
|
||
| wp_recursive_ksort( $data ); | ||
| wp_recursive_ksort( $expected ); | ||
|
|
||
| $this->assertSameSets( $data, $expected ); | ||
|
Comment on lines
+535
to
+539
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it preferred sorting arrays before assertions, or can we use something like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the deeply nested array of arrays are being recursively key sorted before the assertion. Instead of I'm wondering though why this needed. Pulling down to explore.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @hellofromtonya Let me know if any follow-ups are needed for PHPUnits tests on this PR. |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.