@@ -15,13 +15,13 @@ function test_simple_action() {
1515 do_action ( $ tag );
1616
1717 // Only one event occurred for the hook, with empty args.
18- $ this ->assertEquals ( 1 , $ a ->get_call_count () );
18+ $ this ->assertSame ( 1 , $ a ->get_call_count () );
1919 // Only our hook was called.
20- $ this ->assertEquals ( array ( $ tag ), $ a ->get_tags () );
20+ $ this ->assertSame ( array ( $ tag ), $ a ->get_tags () );
2121
2222 $ argsvar = $ a ->get_args ();
2323 $ args = array_pop ( $ argsvar );
24- $ this ->assertEquals ( array ( '' ), $ args );
24+ $ this ->assertSame ( array ( '' ), $ args );
2525 }
2626
2727 function test_remove_action () {
@@ -32,14 +32,14 @@ function test_remove_action() {
3232 do_action ( $ tag );
3333
3434 // Make sure our hook was called correctly.
35- $ this ->assertEquals ( 1 , $ a ->get_call_count () );
36- $ this ->assertEquals ( array ( $ tag ), $ a ->get_tags () );
35+ $ this ->assertSame ( 1 , $ a ->get_call_count () );
36+ $ this ->assertSame ( array ( $ tag ), $ a ->get_tags () );
3737
3838 // Now remove the action, do it again, and make sure it's not called this time.
3939 remove_action ( $ tag , array ( &$ a , 'action ' ) );
4040 do_action ( $ tag );
41- $ this ->assertEquals ( 1 , $ a ->get_call_count () );
42- $ this ->assertEquals ( array ( $ tag ), $ a ->get_tags () );
41+ $ this ->assertSame ( 1 , $ a ->get_call_count () );
42+ $ this ->assertSame ( array ( $ tag ), $ a ->get_tags () );
4343
4444 }
4545
@@ -50,7 +50,7 @@ function test_has_action() {
5050 $ this ->assertFalse ( has_action ( $ tag , $ func ) );
5151 $ this ->assertFalse ( has_action ( $ tag ) );
5252 add_action ( $ tag , $ func );
53- $ this ->assertEquals ( 10 , has_action ( $ tag , $ func ) );
53+ $ this ->assertSame ( 10 , has_action ( $ tag , $ func ) );
5454 $ this ->assertTrue ( has_action ( $ tag ) );
5555 remove_action ( $ tag , $ func );
5656 $ this ->assertFalse ( has_action ( $ tag , $ func ) );
@@ -70,8 +70,8 @@ function test_multiple_actions() {
7070 do_action ( $ tag );
7171
7272 // Both actions called once each.
73- $ this ->assertEquals ( 1 , $ a1 ->get_call_count () );
74- $ this ->assertEquals ( 1 , $ a2 ->get_call_count () );
73+ $ this ->assertSame ( 1 , $ a1 ->get_call_count () );
74+ $ this ->assertSame ( 1 , $ a2 ->get_call_count () );
7575 }
7676
7777 function test_action_args_1 () {
@@ -84,9 +84,9 @@ function test_action_args_1() {
8484 do_action ( $ tag , $ val );
8585
8686 $ call_count = $ a ->get_call_count ();
87- $ this ->assertEquals ( 1 , $ call_count );
87+ $ this ->assertSame ( 1 , $ call_count );
8888 $ argsvar = $ a ->get_args ();
89- $ this ->assertEquals ( array ( $ val ), array_pop ( $ argsvar ) );
89+ $ this ->assertSame ( array ( $ val ), array_pop ( $ argsvar ) );
9090 }
9191
9292 function test_action_args_2 () {
@@ -104,14 +104,14 @@ function test_action_args_2() {
104104
105105 $ call_count = $ a1 ->get_call_count ();
106106 // $a1 should be called with both args.
107- $ this ->assertEquals ( 1 , $ call_count );
107+ $ this ->assertSame ( 1 , $ call_count );
108108 $ argsvar1 = $ a1 ->get_args ();
109- $ this ->assertEquals ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar1 ) );
109+ $ this ->assertSame ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar1 ) );
110110
111111 // $a2 should be called with one only.
112- $ this ->assertEquals ( 1 , $ a2 ->get_call_count () );
112+ $ this ->assertSame ( 1 , $ a2 ->get_call_count () );
113113 $ argsvar2 = $ a2 ->get_args ();
114- $ this ->assertEquals ( array ( $ val1 ), array_pop ( $ argsvar2 ) );
114+ $ this ->assertSame ( array ( $ val1 ), array_pop ( $ argsvar2 ) );
115115 }
116116
117117 /**
@@ -138,19 +138,19 @@ function test_action_args_3() {
138138
139139 $ call_count = $ a1 ->get_call_count ();
140140 // $a1 should be called with both args.
141- $ this ->assertEquals ( 1 , $ call_count );
141+ $ this ->assertSame ( 1 , $ call_count );
142142 $ argsvar1 = $ a1 ->get_args ();
143- $ this ->assertEquals ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar1 ) );
143+ $ this ->assertSame ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar1 ) );
144144
145145 // $a2 should be called with one only.
146- $ this ->assertEquals ( 1 , $ a2 ->get_call_count () );
146+ $ this ->assertSame ( 1 , $ a2 ->get_call_count () );
147147 $ argsvar2 = $ a2 ->get_args ();
148- $ this ->assertEquals ( array ( $ val1 ), array_pop ( $ argsvar2 ) );
148+ $ this ->assertSame ( array ( $ val1 ), array_pop ( $ argsvar2 ) );
149149
150150 // $a3 should be called with both args.
151- $ this ->assertEquals ( 1 , $ a3 ->get_call_count () );
151+ $ this ->assertSame ( 1 , $ a3 ->get_call_count () );
152152 $ argsvar3 = $ a3 ->get_args ();
153- $ this ->assertEquals ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar3 ) );
153+ $ this ->assertSame ( array ( $ val1 , $ val2 ), array_pop ( $ argsvar3 ) );
154154 }
155155
156156 /**
@@ -181,7 +181,7 @@ function test_action_priority() {
181181 do_action ( $ tag );
182182
183183 // Two events, one per action.
184- $ this ->assertEquals ( 2 , $ a ->get_call_count () );
184+ $ this ->assertSame ( 2 , $ a ->get_call_count () );
185185
186186 $ expected = array (
187187 // 'action2' is called first because it has priority 9.
@@ -198,7 +198,7 @@ function test_action_priority() {
198198 ),
199199 );
200200
201- $ this ->assertEquals ( $ expected , $ a ->get_events () );
201+ $ this ->assertSame ( $ expected , $ a ->get_events () );
202202 }
203203
204204 function test_did_action () {
@@ -207,8 +207,8 @@ function test_did_action() {
207207
208208 // Do action $tag1 but not $tag2.
209209 do_action ( $ tag1 );
210- $ this ->assertEquals ( 1 , did_action ( $ tag1 ) );
211- $ this ->assertEquals ( 0 , did_action ( $ tag2 ) );
210+ $ this ->assertSame ( 1 , did_action ( $ tag1 ) );
211+ $ this ->assertSame ( 0 , did_action ( $ tag2 ) );
212212
213213 // Do action $tag2 a random number of times.
214214 $ count = rand ( 0 , 10 );
@@ -217,8 +217,8 @@ function test_did_action() {
217217 }
218218
219219 // $tag1's count hasn't changed, $tag2 should be correct.
220- $ this ->assertEquals ( 1 , did_action ( $ tag1 ) );
221- $ this ->assertEquals ( $ count , did_action ( $ tag2 ) );
220+ $ this ->assertSame ( 1 , did_action ( $ tag1 ) );
221+ $ this ->assertSame ( $ count , did_action ( $ tag2 ) );
222222
223223 }
224224
@@ -229,17 +229,17 @@ function test_all_action() {
229229
230230 // Add an 'all' action.
231231 add_action ( 'all ' , array ( &$ a , 'action ' ) );
232- $ this ->assertEquals ( 10 , has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
232+ $ this ->assertSame ( 10 , has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
233233 // Do some actions.
234234 do_action ( $ tag1 );
235235 do_action ( $ tag2 );
236236 do_action ( $ tag1 );
237237 do_action ( $ tag1 );
238238
239239 // Our action should have been called once for each tag.
240- $ this ->assertEquals ( 4 , $ a ->get_call_count () );
240+ $ this ->assertSame ( 4 , $ a ->get_call_count () );
241241 // Only our hook was called.
242- $ this ->assertEquals ( array ( $ tag1 , $ tag2 , $ tag1 , $ tag1 ), $ a ->get_tags () );
242+ $ this ->assertSame ( array ( $ tag1 , $ tag2 , $ tag1 , $ tag1 ), $ a ->get_tags () );
243243
244244 remove_action ( 'all ' , array ( &$ a , 'action ' ) );
245245 $ this ->assertFalse ( has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
@@ -251,19 +251,19 @@ function test_remove_all_action() {
251251 $ tag = __FUNCTION__ ;
252252
253253 add_action ( 'all ' , array ( &$ a , 'action ' ) );
254- $ this ->assertEquals ( 10 , has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
254+ $ this ->assertSame ( 10 , has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
255255 do_action ( $ tag );
256256
257257 // Make sure our hook was called correctly.
258- $ this ->assertEquals ( 1 , $ a ->get_call_count () );
259- $ this ->assertEquals ( array ( $ tag ), $ a ->get_tags () );
258+ $ this ->assertSame ( 1 , $ a ->get_call_count () );
259+ $ this ->assertSame ( array ( $ tag ), $ a ->get_tags () );
260260
261261 // Now remove the action, do it again, and make sure it's not called this time.
262262 remove_action ( 'all ' , array ( &$ a , 'action ' ) );
263263 $ this ->assertFalse ( has_filter ( 'all ' , array ( &$ a , 'action ' ) ) );
264264 do_action ( $ tag );
265- $ this ->assertEquals ( 1 , $ a ->get_call_count () );
266- $ this ->assertEquals ( array ( $ tag ), $ a ->get_tags () );
265+ $ this ->assertSame ( 1 , $ a ->get_call_count () );
266+ $ this ->assertSame ( array ( $ tag ), $ a ->get_tags () );
267267 }
268268
269269 function test_action_ref_array () {
@@ -312,7 +312,7 @@ function test_action_keyed_array() {
312312 function test_action_self_removal () {
313313 add_action ( 'test_action_self_removal ' , array ( $ this , 'action_self_removal ' ) );
314314 do_action ( 'test_action_self_removal ' );
315- $ this ->assertEquals ( 1 , did_action ( 'test_action_self_removal ' ) );
315+ $ this ->assertSame ( 1 , did_action ( 'test_action_self_removal ' ) );
316316 }
317317
318318 function action_self_removal () {
@@ -332,8 +332,8 @@ function test_action_recursion() {
332332 add_action ( $ tag , array ( $ this , 'action_that_causes_recursion ' ), 12 , 1 );
333333 do_action ( $ tag , $ tag );
334334
335- $ this ->assertEquals ( 2 , $ a ->get_call_count (), 'recursive actions should call all callbacks with earlier priority ' );
336- $ this ->assertEquals ( 2 , $ b ->get_call_count (), 'recursive actions should call callbacks with later priority ' );
335+ $ this ->assertSame ( 2 , $ a ->get_call_count (), 'recursive actions should call all callbacks with earlier priority ' );
336+ $ this ->assertSame ( 2 , $ b ->get_call_count (), 'recursive actions should call callbacks with later priority ' );
337337 }
338338
339339 function action_that_causes_recursion ( $ tag ) {
@@ -364,11 +364,11 @@ function test_action_callback_manipulation_while_running() {
364364 do_action ( $ tag , $ tag , array ( $ a , $ b , $ c , $ d , $ e ) );
365365 do_action ( $ tag , $ tag , array ( $ a , $ b , $ c , $ d , $ e ) );
366366
367- $ this ->assertEquals ( 2 , $ a ->get_call_count (), 'callbacks should run unless otherwise instructed ' );
368- $ this ->assertEquals ( 1 , $ b ->get_call_count (), 'callback removed by same priority callback should still get called ' );
369- $ this ->assertEquals ( 1 , $ c ->get_call_count (), 'callback added by same priority callback should not get called ' );
370- $ this ->assertEquals ( 2 , $ d ->get_call_count (), 'callback added by earlier priority callback should get called ' );
371- $ this ->assertEquals ( 1 , $ e ->get_call_count (), 'callback added by later priority callback should not get called ' );
367+ $ this ->assertSame ( 2 , $ a ->get_call_count (), 'callbacks should run unless otherwise instructed ' );
368+ $ this ->assertSame ( 1 , $ b ->get_call_count (), 'callback removed by same priority callback should still get called ' );
369+ $ this ->assertSame ( 1 , $ c ->get_call_count (), 'callback added by same priority callback should not get called ' );
370+ $ this ->assertSame ( 2 , $ d ->get_call_count (), 'callback added by earlier priority callback should get called ' );
371+ $ this ->assertSame ( 1 , $ e ->get_call_count (), 'callback added by later priority callback should not get called ' );
372372 }
373373
374374 function action_that_manipulates_a_running_hook ( $ tag , $ mocks ) {
@@ -435,7 +435,7 @@ function test_array_access_of_wp_filter_global() {
435435 'accepted_args ' => 1 ,
436436 ),
437437 );
438- $ this ->assertEquals ( 11 , has_action ( $ tag , '__return_null ' ) );
438+ $ this ->assertSame ( 11 , has_action ( $ tag , '__return_null ' ) );
439439 }
440440
441441 /**
@@ -448,7 +448,7 @@ function test_current_action() {
448448 $ wp_current_filter [] = 'first ' ;
449449 $ wp_current_filter [] = 'second ' ; // Let's say a second action was invoked.
450450
451- $ this ->assertEquals ( 'second ' , current_action () );
451+ $ this ->assertSame ( 'second ' , current_action () );
452452 }
453453
454454 /**
@@ -498,7 +498,7 @@ function test_doing_filter_real() {
498498
499499 add_filter ( 'testing ' , array ( $ this , 'apply_testing_filter ' ) );
500500 $ this ->assertTrue ( has_action ( 'testing ' ) );
501- $ this ->assertEquals ( 10 , has_action ( 'testing ' , array ( $ this , 'apply_testing_filter ' ) ) );
501+ $ this ->assertSame ( 10 , has_action ( 'testing ' , array ( $ this , 'apply_testing_filter ' ) ) );
502502
503503 apply_filters ( 'testing ' , '' );
504504
@@ -519,7 +519,7 @@ function apply_testing_filter() {
519519
520520 add_filter ( 'testing_nested ' , array ( $ this , 'apply_testing_nested_filter ' ) );
521521 $ this ->assertTrue ( has_action ( 'testing_nested ' ) );
522- $ this ->assertEquals ( 10 , has_action ( 'testing_nested ' , array ( $ this , 'apply_testing_nested_filter ' ) ) );
522+ $ this ->assertSame ( 10 , has_action ( 'testing_nested ' , array ( $ this , 'apply_testing_nested_filter ' ) ) );
523523
524524 apply_filters ( 'testing_nested ' , '' );
525525
0 commit comments