-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Global Styles: Add slashes back to the Theme JSON (#33919)
* Global Styles: Add slashes back to the Theme JSON * Change PHP strip/add slashes to use the WordPress functions * Add a unit test for global styles * fix typo
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* Test the Global Styles lib | ||
* | ||
* @package Gutenberg | ||
*/ | ||
|
||
class WP_Global_Styles_Test extends WP_UnitTestCase { | ||
function test_gutenberg_global_styles_filter_post() { | ||
$user_theme_json = '{ | ||
"isGlobalStylesUserThemeJSON": 1, | ||
"version": 1, | ||
"settings": { | ||
"typography": { | ||
"fontFamilies": { | ||
"fontFamily": "\"DM Sans\", sans-serif", | ||
"slug": "dm-sans", | ||
"name": "DM Sans", | ||
} | ||
} | ||
} | ||
}'; | ||
|
||
$filtered_user_theme_json = gutenberg_global_styles_filter_post( $user_theme_json ); | ||
$this->assertEquals( $user_theme_json, $filtered_user_theme_json ); | ||
} | ||
} |