Skip to content

Commit 0fadc15

Browse files
committed
Update the tests.
1 parent 25ed69e commit 0fadc15

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

tests/phpunit/includes/utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function action2( $arg ) {
134134
}
135135

136136
/**
137-
* @since 6.6.0
137+
* @since 6.9.0
138138
*/
139139
public function action3( array $arg ) {
140140
$current_filter = $this->current_filter();

tests/phpunit/tests/actions.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,29 +96,6 @@ 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-
12299
/**
123100
* One tag with multiple actions.
124101
*
@@ -231,6 +208,29 @@ public function test_action_args_3() {
231208
$this->assertSame( array( $val1, $val2 ), array_pop( $argsvar3 ) );
232209
}
233210

211+
/**
212+
* One tag with array with 1 object to ensure it will stay an array and not become an object
213+
*
214+
* @ticket 60190
215+
*
216+
* @covers ::do_action
217+
*/
218+
public function test_action_array_of_object_arg() {
219+
$a = new MockAction();
220+
$hook_name = __FUNCTION__;
221+
$val = new stdClass();
222+
$arg = array( $val );
223+
224+
add_action( $hook_name, array( $a, 'action3' ) );
225+
do_action( $hook_name, $arg );
226+
227+
$call_count = $a->get_call_count();
228+
$argsvar = $a->get_args();
229+
230+
// nested since func_get_args() returns the args as an array
231+
$this->assertSame( array( $arg ), array_pop( $argsvar ) );
232+
}
233+
234234
/**
235235
* @ticket 60193
236236
*

0 commit comments

Comments
 (0)