Skip to content

Commit

Permalink
Test deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Sep 20, 2024
1 parent d864449 commit 7836320
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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' ) );
Expand Down

0 comments on commit 7836320

Please sign in to comment.