Changeset 57822
- Timestamp:
- 03/12/2024 06:52:20 PM (9 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php
r57821 r57822 11 11 * @group interactivity-api 12 12 */ 13 class Tests_Interactivity_API_ Functions extends WP_UnitTestCase {13 class Tests_Interactivity_API_wpInteractivityAPIFunctions extends WP_UnitTestCase { 14 14 /** 15 15 * Set up. … … 391 391 $this->assertEquals( 'data-wp-context=\'{"amp":"T\u0026T"}\'', wp_interactivity_data_wp_context( array( 'amp' => 'T&T' ) ) ); 392 392 } 393 394 /** 395 * Tests that directives processing of tags that don't visit closer tag work. 396 * 397 * @ticket 60746 398 * 399 * @covers ::wp_interactivity_process_directives_of_interactive_blocks 400 */ 401 public function test_process_directives_in_tags_that_dont_visit_closer_tag() { 402 register_block_type( 403 'test/custom-directive-block', 404 array( 405 'render_callback' => function () { 406 return '<iframe data-wp-interactive="nameSpace" ' . wp_interactivity_data_wp_context( array( 'text' => 'test' ) ) . ' data-wp-class--test="context.text" src="1"></iframe>'; 407 }, 408 'supports' => array( 409 'interactivity' => true, 410 ), 411 ) 412 ); 413 $post_content = '<!-- wp:test/custom-directive-block /-->'; 414 $processed_content = do_blocks( $post_content ); 415 $processor = new WP_HTML_Tag_Processor( $processed_content ); 416 $processor->next_tag( array( 'class_name' => 'test' ) ); 417 unregister_block_type( 'test/custom-directive-block' ); 418 $this->assertEquals( '1', $processor->get_attribute( 'src' ) ); 419 } 393 420 }
Note: See TracChangeset
for help on using the changeset viewer.