Changeset 53808 for trunk/tests/phpunit/tests/actions.php
- Timestamp:
- 07/31/2022 09:35:40 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/actions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/actions.php
r53806 r53808 332 332 */ 333 333 public function test_action_keyed_array() { 334 $a = new MockAction(); 335 334 $a = new MockAction(); 336 335 $hook_name = __FUNCTION__; 337 336 … … 362 361 */ 363 362 public function test_action_closure() { 364 $hook_name = 'test_action_closure';363 $hook_name = __FUNCTION__; 365 364 $closure = static function( $a, $b ) { 366 365 $GLOBALS[ $a ] = $b; … … 375 374 $this->assertSame( $GLOBALS[ $context[0] ], $context[1] ); 376 375 377 $hook_name2 = 'test_action_closure_2';376 $hook_name2 = __FUNCTION__ . '_2'; 378 377 $closure2 = static function() { 379 378 $GLOBALS['closure_no_args'] = true; … … 389 388 remove_action( $hook_name, $closure ); 390 389 remove_action( $hook_name2, $closure2 ); 390 } 391 392 /** 393 * @ticket 23265 394 * 395 * @covers ::add_action 396 */ 397 public function test_action_callback_representations() { 398 $hook_name = __FUNCTION__; 399 400 $this->assertFalse( has_action( $hook_name ) ); 401 402 add_action( $hook_name, array( 'Class', 'method' ) ); 403 404 $this->assertSame( 10, has_action( $hook_name, array( 'Class', 'method' ) ) ); 405 406 $this->assertSame( 10, has_action( $hook_name, 'Class::method' ) ); 391 407 } 392 408
Note: See TracChangeset
for help on using the changeset viewer.