Skip to content

Commit 3b3d7de

Browse files
Add test doc blocks
1 parent dfb65fb commit 3b3d7de

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/phpunit/tests/theme/wpThemeJson.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6412,6 +6412,15 @@ public function test_opt_in_to_block_style_variations() {
64126412
$this->assertSame( $expected, $button_variations );
64136413
}
64146414

6415+
/**
6416+
* Tests that block-level settings inherit global default settings when not explicitly set.
6417+
*
6418+
* When a block doesn't have its own default presets setting, it should inherit
6419+
* the global setting from the theme. This affects whether default presets
6420+
* are filtered out during merging.
6421+
*
6422+
* @ticket 64195
6423+
*/
64156424
public function test_merge_incoming_data_block_level_inherits_global_default_setting() {
64166425
$defaults = new WP_Theme_JSON(
64176426
array(
@@ -6518,6 +6527,16 @@ public function test_merge_incoming_data_block_level_inherits_global_default_set
65186527
$this->assertEqualSetsWithIndex( $expected, $actual );
65196528
}
65206529

6530+
/**
6531+
* Tests that presets with unique slugs are preserved during merging.
6532+
*
6533+
* When merging theme presets, any preset with a slug that doesn't match
6534+
* a default preset should always be preserved, regardless of default
6535+
* preset settings. Only presets with matching slugs should be filtered out
6536+
* when defaults are enabled.
6537+
*
6538+
* @ticket 64195
6539+
*/
65216540
public function test_merge_incoming_data_unique_slugs_always_preserved() {
65226541
$defaults = new WP_Theme_JSON(
65236542
array(

0 commit comments

Comments
 (0)