- Timestamp:
- 07/16/2024 06:20:43 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php
r58594 r58738 333 333 ) 334 334 ); 335 function test_render_block_data( $parsed_block ) { 335 336 $test_render_block_data = static function ( $parsed_block ) { 336 337 $parsed_block['testKey'] = true; 337 338 return $parsed_block; 338 } 339 add_filter( 'render_block_data', 'test_render_block_data' ); 339 }; 340 341 add_filter( 'render_block_data', $test_render_block_data ); 340 342 $post_content = '<!-- wp:test/custom-directive-block /-->'; 341 343 $processed_content = do_blocks( $post_content ); 342 344 $processor = new WP_HTML_Tag_Processor( $processed_content ); 343 345 $processor->next_tag( array( 'data-wp-interactive' => 'nameSpace' ) ); 344 remove_filter( 'render_block_data', 'test_render_block_data');346 remove_filter( 'render_block_data', $test_render_block_data ); 345 347 unregister_block_type( 'test/custom-directive-block' ); 346 348 $this->assertSame( 'test', $processor->get_attribute( 'value' ) );
Note: See TracChangeset
for help on using the changeset viewer.