From fe80e7b2e25659c4661d9c2a8b98291be7b0374d Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Thu, 8 Dec 2022 11:53:18 +1100 Subject: [PATCH] Add a simple test --- phpunit/class-wp-theme-json-test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 15932f7398bfa..7a0048b121d2d 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -751,6 +751,30 @@ public function test_get_stylesheet_with_block_support_feature_level_selectors() $this->assertEquals( $expected, $theme_json->get_stylesheet() ); } + public function test_allow_inferred_properties() { + $actual = WP_Theme_JSON_Gutenberg::remove_insecure_properties( + array( + 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA, + 'styles' => array( + 'spacing' => array( + 'blockGap' => '3em', + ), + ), + ) + ); + + $expected = array( + 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA, + 'styles' => array( + 'spacing' => array( + 'blockGap' => '3em', + ), + ), + ); + + $this->assertEqualSetsWithIndex( $expected, $actual ); + } + public function test_remove_invalid_element_pseudo_selectors() { $actual = WP_Theme_JSON_Gutenberg::remove_insecure_properties( array(