Changeset 53804 for trunk/tests/phpunit/tests/hooks/hasFilter.php
- Timestamp:
- 07/31/2022 03:03:46 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/hooks/hasFilter.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/hooks/hasFilter.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 $this->assertSame( $priority, $hook->has_filter( $ tag, $callback ) );20 $this->assertSame( $priority, $hook->has_filter( $hook_name, $callback ) ); 21 21 } 22 22 … … 25 25 $callback = array( $a, 'action' ); 26 26 $hook = new WP_Hook(); 27 $ tag= __FUNCTION__;27 $hook_name = __FUNCTION__; 28 28 $priority = 1; 29 29 $accepted_args = 2; 30 30 31 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );31 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 32 32 33 $this->assertSame( $priority, $hook->has_filter( $ tag, $callback ) );33 $this->assertSame( $priority, $hook->has_filter( $hook_name, $callback ) ); 34 34 } 35 35 … … 37 37 $callback = array( 'MockAction', 'action' ); 38 38 $hook = new WP_Hook(); 39 $ tag= __FUNCTION__;39 $hook_name = __FUNCTION__; 40 40 $priority = 1; 41 41 $accepted_args = 2; 42 42 43 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );43 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 44 44 45 $this->assertSame( $priority, $hook->has_filter( $ tag, $callback ) );45 $this->assertSame( $priority, $hook->has_filter( $hook_name, $callback ) ); 46 46 } 47 47 … … 49 49 $callback = '__return_null'; 50 50 $hook = new WP_Hook(); 51 $ tag= __FUNCTION__;51 $hook_name = __FUNCTION__; 52 52 $priority = 1; 53 53 $accepted_args = 2; 54 54 55 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );55 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 56 56 57 57 $this->assertTrue( $hook->has_filter() ); … … 64 64 65 65 public function test_not_has_filter_with_callback() { 66 $callback = '__return_null';67 $hook = new WP_Hook();68 $ tag= __FUNCTION__;66 $callback = '__return_null'; 67 $hook = new WP_Hook(); 68 $hook_name = __FUNCTION__; 69 69 70 $this->assertFalse( $hook->has_filter( $ tag, $callback ) );70 $this->assertFalse( $hook->has_filter( $hook_name, $callback ) ); 71 71 } 72 72 … … 74 74 $callback = '__return_null'; 75 75 $hook = new WP_Hook(); 76 $ tag= __FUNCTION__;76 $hook_name = __FUNCTION__; 77 77 $priority = 1; 78 78 $accepted_args = 2; 79 79 80 $hook->add_filter( $ tag, $callback, $priority, $accepted_args );80 $hook->add_filter( $hook_name, $callback, $priority, $accepted_args ); 81 81 82 $this->assertFalse( $hook->has_filter( $ tag, '__return_false' ) );82 $this->assertFalse( $hook->has_filter( $hook_name, '__return_false' ) ); 83 83 } 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.