Changeset 53805 for trunk/tests/phpunit/tests/filters.php
- Timestamp:
- 07/31/2022 04:25:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/filters.php
r53804 r53805 19 19 $this->assertSame( 1, $a->get_call_count() ); 20 20 // Only our hook was called. 21 $this->assertSame( array( $hook_name ), $a->get_ tags() );21 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 22 22 23 23 $argsvar = $a->get_args(); … … 36 36 // Make sure our hook was called correctly. 37 37 $this->assertSame( 1, $a->get_call_count() ); 38 $this->assertSame( array( $hook_name ), $a->get_ tags() );38 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 39 39 40 40 // Now remove the filter, do it again, and make sure it's not called this time. … … 42 42 $this->assertSame( $val, apply_filters( $hook_name, $val ) ); 43 43 $this->assertSame( 1, $a->get_call_count() ); 44 $this->assertSame( array( $hook_name ), $a->get_ tags() );44 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 45 45 46 46 } … … 136 136 // 'filter2' is called first because it has priority 9. 137 137 array( 138 'filter' => 'filter2', 139 'tag' => $hook_name, 140 'args' => array( $val ), 138 'filter' => 'filter2', 139 'hook_name' => $hook_name, 140 'tag' => $hook_name, // Back compat. 141 'args' => array( $val ), 141 142 ), 142 143 // 'filter' is called second. 143 144 array( 144 'filter' => 'filter', 145 'tag' => $hook_name, 146 'args' => array( $val ), 145 'filter' => 'filter', 146 'hook_name' => $hook_name, 147 'tag' => $hook_name, // Back compat. 148 'args' => array( $val ), 147 149 ), 148 150 ); … … 193 195 $this->assertSame( 4, $a->get_call_count() ); 194 196 // The right hooks should have been called in order. 195 $this->assertSame( array( $hook_name1, $hook_name2, $hook_name1, $hook_name1 ), $a->get_ tags() );197 $this->assertSame( array( $hook_name1, $hook_name2, $hook_name1, $hook_name1 ), $a->get_hook_names() ); 196 198 197 199 remove_filter( 'all', array( $a, 'filterall' ) ); … … 212 214 // Make sure our hook was called correctly. 213 215 $this->assertSame( 1, $a->get_call_count() ); 214 $this->assertSame( array( $hook_name ), $a->get_ tags() );216 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 215 217 216 218 // Now remove the filter, do it again, and make sure it's not called this time. … … 221 223 // Call cound should remain at 1. 222 224 $this->assertSame( 1, $a->get_call_count() ); 223 $this->assertSame( array( $hook_name ), $a->get_ tags() );225 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 224 226 } 225 227
Note: See TracChangeset
for help on using the changeset viewer.