Changeset 53804 for trunk/tests/phpunit/tests/hooks/removeAllFilters.php
- Timestamp:
- 07/31/2022 03:03:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/hooks/removeAllFilters.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 $hook->remove_all_filters(); … … 27 27 $callback_two = '__return_false'; 28 28 $hook = new WP_Hook(); 29 $ tag= __FUNCTION__;29 $hook_name = __FUNCTION__; 30 30 $priority = 1; 31 31 $accepted_args = 2; 32 32 33 $hook->add_filter( $ tag, $callback_one, $priority, $accepted_args );34 $hook->add_filter( $ tag, $callback_two, $priority + 1, $accepted_args );33 $hook->add_filter( $hook_name, $callback_one, $priority, $accepted_args ); 34 $hook->add_filter( $hook_name, $callback_two, $priority + 1, $accepted_args ); 35 35 36 36 $hook->remove_all_filters( $priority ); 37 37 38 $this->assertFalse( $hook->has_filter( $ tag, $callback_one ) );38 $this->assertFalse( $hook->has_filter( $hook_name, $callback_one ) ); 39 39 $this->assertTrue( $hook->has_filters() ); 40 $this->assertSame( $priority + 1, $hook->has_filter( $ tag, $callback_two ) );40 $this->assertSame( $priority + 1, $hook->has_filter( $hook_name, $callback_two ) ); 41 41 } 42 42 }
Note: See TracChangeset
for help on using the changeset viewer.