Changeset 53804 for trunk/tests/phpunit/tests/hooks/hasFilters.php
- Timestamp:
- 07/31/2022 03:03:46 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/hooks/hasFilters.php
r52389 r53804 12 12 $callback = '__return_null'; 13 13 $hook = new WP_Hook(); 14 $ tag= __FUNCTION__;14 $hook_name = __FUNCTION__; 15 15 $priority = 1; 16 16 $accepted_args = 2; 17 17 18 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );18 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 19 19 20 20 $this->assertTrue( $hook->has_filters() ); … … 29 29 $callback = '__return_null'; 30 30 $hook = new WP_Hook(); 31 $ tag= __FUNCTION__;31 $hook_name = __FUNCTION__; 32 32 $priority = 1; 33 33 $accepted_args = 2; 34 34 35 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );36 $hook->remove_filter( $ tag, $callback, $priority );35 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 36 $hook->remove_filter( $hook_name, $callback, $priority ); 37 37 $this->assertFalse( $hook->has_filters() ); 38 38 } … … 41 41 $callback = '__return_null'; 42 42 $hook = new WP_Hook(); 43 $ tag= __FUNCTION__;43 $hook_name = __FUNCTION__; 44 44 $priority = 1; 45 45 $accepted_args = 2; 46 46 47 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );48 $function_key = _wp_filter_build_unique_id( $ tag, $callback, $priority );47 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 48 $function_key = _wp_filter_build_unique_id( $hook_name, $callback, $priority ); 49 49 unset( $hook->callbacks[ $priority ][ $function_key ] ); 50 50
Note: See TracChangeset
for help on using the changeset viewer.