Changeset 57043 for branches/6.4/tests/phpunit/tests/blocks/serialize.php
- Timestamp:
- 11/01/2023 12:44:02 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.4/tests/phpunit/tests/blocks/serialize.php
r56701 r57043 75 75 } 76 76 77 /** 78 * @ticket 59669 79 * 80 * @covers ::traverse_and_serialize_blocks 81 */ 82 public function test_traverse_and_serialize_blocks_post_callback_modifies_current_block() { 83 $markup = "<!-- wp:outer --><!-- wp:inner {\"key\":\"value\"} -->Example.<!-- /wp:inner -->\n\nExample.\n\n<!-- wp:void /--><!-- /wp:outer -->"; 84 $blocks = parse_blocks( $markup ); 85 86 $actual = traverse_and_serialize_blocks( $blocks, null, array( __CLASS__, 'add_attribute_to_inner_block' ) ); 87 88 $this->assertSame( 89 "<!-- wp:outer --><!-- wp:inner {\"key\":\"value\",\"myattr\":\"myvalue\"} -->Example.<!-- /wp:inner -->\n\nExample.\n\n<!-- wp:void /--><!-- /wp:outer -->", 90 $actual 91 ); 92 } 93 77 94 public static function add_attribute_to_inner_block( &$block ) { 78 95 if ( 'core/inner' === $block['blockName'] ) {
Note: See TracChangeset
for help on using the changeset viewer.