From 78363203bb174c147b205d392d5f7e4ae3ccc06d Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Fri, 20 Sep 2024 20:51:05 +0200 Subject: [PATCH] Test deprecation --- .../tests/interactivity-api/wpInteractivityAPI.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php index e9349190ebdb2..8d190a93aafc1 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php @@ -211,6 +211,17 @@ public function test_config_not_printed_when_empty() { $this->expectOutputString( '' ); } + /** + * Test that the deprecated register_script_modules method is deprecated but does not throw. + * + * @ticket 60647 + * + * @expectedDeprecated WP_Interactivity_API::register_script_modules + */ + public function test_register_script_modules_deprecated() { + $this->interactivity->register_script_modules(); + } + /** * Sets up an activity, runs an optional callback, and returns a MockAction for inspection. * @@ -221,7 +232,6 @@ public function test_config_not_printed_when_empty() { */ private function get_script_data_filter_result( ?Closure $callback = null ): MockAction { $this->interactivity->add_hooks(); - $this->interactivity->register_script_modules(); wp_enqueue_script_module( '@wordpress/interactivity' ); $filter = new MockAction(); add_filter( 'script_module_data_@wordpress/interactivity', array( $filter, 'filter' ) );