Changeset 61118 for trunk/tests/phpunit/tests/hooks/hasFilter.php
- Timestamp:
- 11/03/2025 11:45:40 PM (2 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/hooks/hasFilter.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/hooks/hasFilter.php
r53804 r61118 9 9 class Tests_Hooks_HasFilter extends WP_UnitTestCase { 10 10 11 /** 12 * @ticket 64186 13 */ 11 14 public function test_has_filter_with_function() { 12 15 $callback = '__return_null'; 13 16 $hook = new WP_Hook(); 14 17 $hook_name = __FUNCTION__; 15 $priority = 1; 18 $priority_a = 1; 19 $priority_b = 10; 16 20 $accepted_args = 2; 17 21 18 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 22 $hook->add_filter( $hook_name, $callback, $priority_a, $accepted_args ); 23 $hook->add_filter( $hook_name, $callback, $priority_b, $accepted_args ); 19 24 20 $this->assertSame( $priority, $hook->has_filter( $hook_name, $callback ) ); 25 $this->assertSame( $priority_a, $hook->has_filter( $hook_name, $callback ) ); 26 $this->assertTrue( $hook->has_filter( $hook_name, $callback, $priority_a ) ); 27 $this->assertTrue( $hook->has_filter( $hook_name, $callback, $priority_b ) ); 28 $hook->remove_filter( $hook_name, $callback, $priority_a ); 29 $this->assertSame( $priority_b, $hook->has_filter( $hook_name, $callback ) ); 21 30 } 22 31
Note: See TracChangeset
for help on using the changeset viewer.