Skip to content

Commit

Permalink
Fix test pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz committed Jan 26, 2024
1 parent c64be1e commit f9cd9c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/phpunit/tests/interactivity-api/interactivity-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public function test_process_directives_only_process_the_root_interactive_blocks
$class = new ReflectionClass( 'WP_Interactivity_API' );
$directive_processors = $class->getProperty( 'directive_processors' );
$directive_processors->setAccessible( true );
$old_directive_processors = $directive_processors->getValue();
$directive_processors->setValue( null, array( 'data-wp-test' => array( $this, 'data_wp_test_processor' ) ) );
$html = '<div data-wp-test></div>';
$this->data_wp_test_processor_count = 0;
Expand All @@ -213,5 +214,6 @@ public function test_process_directives_only_process_the_root_interactive_blocks
do_blocks( $post_content );
$this->assertEquals( 2, $this->data_wp_test_processor_count );
unregister_block_type( 'test/custom-directive-block' );
$directive_processors->setValue( null, $old_directive_processors );
}
}

0 comments on commit f9cd9c0

Please sign in to comment.