Changeset 53804 for trunk/tests/phpunit/tests/hooks/preinitHooks.php
- Timestamp:
- 07/31/2022 03:03:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/hooks/preinitHooks.php
r52389 r53804 10 10 11 11 public function test_array_to_hooks() { 12 $ tag1= __FUNCTION__ . '_1';13 $priority1 = 1;14 $ tag2= __FUNCTION__ . '_2';15 $priority2 = 2;16 $filters = array(17 $ tag1 => array(12 $hook_name1 = __FUNCTION__ . '_1'; 13 $priority1 = 1; 14 $hook_name2 = __FUNCTION__ . '_2'; 15 $priority2 = 2; 16 $filters = array( 17 $hook_name1 => array( 18 18 $priority1 => array( 19 19 'test1' => array( … … 23 23 ), 24 24 ), 25 $ tag2 => array(25 $hook_name2 => array( 26 26 $priority2 => array( 27 27 'test1' => array( … … 35 35 $hooks = WP_Hook::build_preinitialized_hooks( $filters ); 36 36 37 $this->assertSame( $priority1, $hooks[ $ tag1 ]->has_filter( $tag1, '__return_false' ) );38 $this->assertSame( $priority2, $hooks[ $ tag2 ]->has_filter( $tag2, '__return_null' ) );37 $this->assertSame( $priority1, $hooks[ $hook_name1 ]->has_filter( $hook_name1, '__return_false' ) ); 38 $this->assertSame( $priority2, $hooks[ $hook_name2 ]->has_filter( $hook_name2, '__return_null' ) ); 39 39 } 40 40 }
Note: See TracChangeset
for help on using the changeset viewer.