@@ -96,6 +96,29 @@ public function test_has_action() {
9696 $ this ->assertFalse ( has_action ( $ hook_name ) );
9797 }
9898
99+ /**
100+ * One tag with array with 1 object to ensure it will stay an array and not become an object
101+ *
102+ * @ticket 60190
103+ *
104+ * @covers ::do_action
105+ */
106+ public function test_action_array_of_object_arg () {
107+ $ a = new MockAction ();
108+ $ hook_name = __FUNCTION__ ;
109+ $ val = new stdClass ();
110+ $ arg = array ( $ val );
111+
112+ add_action ( $ hook_name , array ( $ a , 'action3 ' ) );
113+ do_action ( $ hook_name , $ arg );
114+
115+ $ call_count = $ a ->get_call_count ();
116+ $ argsvar = $ a ->get_args ();
117+
118+ // nested since func_get_args() returns the args as an array
119+ $ this ->assertSame ( array ( $ arg ), array_pop ( $ argsvar ) );
120+ }
121+
99122 /**
100123 * One tag with multiple actions.
101124 *
@@ -208,27 +231,6 @@ public function test_action_args_3() {
208231 $ this ->assertSame ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar3 ) );
209232 }
210233
211- /**
212- * Tests PHP 4 notation for calling actions while passing in an object by reference.
213- *
214- * @ticket 48312
215- *
216- * @covers ::do_action
217- */
218- public function test_action_args_with_php4_syntax () {
219- $ a = new MockAction ();
220- $ hook_name = __FUNCTION__ ;
221- $ val = new stdClass ();
222-
223- add_action ( $ hook_name , array ( &$ a , 'action ' ) );
224- // Call the action with PHP 4 notation for passing object by reference.
225- do_action ( $ hook_name , array ( &$ val ) );
226-
227- $ call_count = $ a ->get_call_count ();
228- $ argsvar = $ a ->get_args ();
229- $ this ->assertSame ( array ( $ val ), array_pop ( $ argsvar ) );
230- }
231-
232234 /**
233235 * @ticket 60193
234236 *
0 commit comments