Skip to content

Commit

Permalink
Add a simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Dec 9, 2022
1 parent ed1044d commit fe80e7b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fe80e7b

Please sign in to comment.