| | 560 | |
| | 561 | /** |
| | 562 | * @ticket 48312 |
| | 563 | * |
| | 564 | * Tests PHP 4 notation for calling actions while passing in an object by reference. |
| | 565 | */ |
| | 566 | function test_action_args_4() { |
| | 567 | $a = new MockAction(); |
| | 568 | $tag = __FUNCTION__; |
| | 569 | $val = new stdClass; |
| | 570 | |
| | 571 | add_action( $tag, array( &$a, 'action' ) ); |
| | 572 | // call the action with PHP 4 notation for passing object by reference |
| | 573 | do_action( $tag, [ $val ] ); |
| | 574 | |
| | 575 | $call_count = $a->get_call_count(); |
| | 576 | $argsvar = $a->get_args(); |
| | 577 | $this->assertEquals( array( $val ), array_pop( $argsvar ) ); |
| | 578 | } |