diff --git a/tests/phpunit/tests/interactivity-api/interactivity-api.php b/tests/phpunit/tests/interactivity-api/interactivity-api.php index ba88737cd65d9..9c86ca74aa018 100644 --- a/tests/phpunit/tests/interactivity-api/interactivity-api.php +++ b/tests/phpunit/tests/interactivity-api/interactivity-api.php @@ -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 = '
'; $this->data_wp_test_processor_count = 0; @@ -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 ); } }