Changeset 53805 for trunk/tests/phpunit/tests/actions.php
- Timestamp:
- 07/31/2022 04:25:27 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/actions.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/actions.php
r53804 r53805 21 21 $this->assertSame( 1, $a->get_call_count() ); 22 22 // Only our hook was called. 23 $this->assertSame( array( $hook_name ), $a->get_ tags() );23 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 24 24 25 25 $argsvar = $a->get_args(); … … 40 40 // Make sure our hook was called correctly. 41 41 $this->assertSame( 1, $a->get_call_count() ); 42 $this->assertSame( array( $hook_name ), $a->get_ tags() );42 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 43 43 44 44 // Now remove the action, do it again, and make sure it's not called this time. … … 46 46 do_action( $hook_name ); 47 47 $this->assertSame( 1, $a->get_call_count() ); 48 $this->assertSame( array( $hook_name ), $a->get_ tags() );48 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 49 49 50 50 } … … 216 216 // 'action2' is called first because it has priority 9. 217 217 array( 218 'action' => 'action2', 219 'tag' => $hook_name, 220 'args' => array( '' ), 218 'action' => 'action2', 219 'hook_name' => $hook_name, 220 'tag' => $hook_name, // Back compat. 221 'args' => array( '' ), 221 222 ), 222 223 // 'action' is called second. 223 224 array( 224 'action' => 'action', 225 'tag' => $hook_name, 226 'args' => array( '' ), 225 'action' => 'action', 226 'hook_name' => $hook_name, 227 'tag' => $hook_name, // Back compat. 228 'args' => array( '' ), 227 229 ), 228 230 ); … … 275 277 $this->assertSame( 4, $a->get_call_count() ); 276 278 // Only our hook was called. 277 $this->assertSame( array( $hook_name1, $hook_name2, $hook_name1, $hook_name1 ), $a->get_ tags() );279 $this->assertSame( array( $hook_name1, $hook_name2, $hook_name1, $hook_name1 ), $a->get_hook_names() ); 278 280 279 281 remove_action( 'all', array( &$a, 'action' ) ); … … 295 297 // Make sure our hook was called correctly. 296 298 $this->assertSame( 1, $a->get_call_count() ); 297 $this->assertSame( array( $hook_name ), $a->get_ tags() );299 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 298 300 299 301 // Now remove the action, do it again, and make sure it's not called this time. … … 302 304 do_action( $hook_name ); 303 305 $this->assertSame( 1, $a->get_call_count() ); 304 $this->assertSame( array( $hook_name ), $a->get_ tags() );306 $this->assertSame( array( $hook_name ), $a->get_hook_names() ); 305 307 } 306 308
Note: See TracChangeset
for help on using the changeset viewer.