Changeset 46568 for trunk/tests/phpunit/tests/actions.php
- Timestamp:
- 10/22/2019 12:09:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/actions.php
r42343 r46568 152 152 $argsvar3 = $a3->get_args(); 153 153 $this->assertEquals( array( $val1, $val2 ), array_pop( $argsvar3 ) ); 154 } 155 156 /** 157 * Tests PHP 4 notation for calling actions while passing in an object by reference. 158 * 159 * @ticket 48312 160 */ 161 function test_action_args_with_php4_syntax() { 162 $a = new MockAction(); 163 $tag = __FUNCTION__; 164 $val = new stdClass; 165 166 add_action( $tag, array( &$a, 'action' ) ); 167 // Ñall the action with PHP 4 notation for passing object by reference. 168 do_action( $tag, array( &$val ) ); 169 170 $call_count = $a->get_call_count(); 171 $argsvar = $a->get_args(); 172 $this->assertSame( array( $val ), array_pop( $argsvar ) ); 154 173 } 155 174
Note: See TracChangeset
for help on using the changeset viewer.