@@ -304,7 +304,7 @@ public function test_get_items(): void {
304304 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities ' );
305305 $ response = $ this ->server ->dispatch ( $ request );
306306
307- $ this ->assertEquals ( 200 , $ response ->get_status () );
307+ $ this ->assertSame ( 200 , $ response ->get_status () );
308308
309309 $ data = $ response ->get_data ();
310310 $ this ->assertIsArray ( $ data );
@@ -327,7 +327,7 @@ public function test_get_item(): void {
327327 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities/test/calculator ' );
328328 $ response = $ this ->server ->dispatch ( $ request );
329329
330- $ this ->assertEquals ( 200 , $ response ->get_status () );
330+ $ this ->assertSame ( 200 , $ response ->get_status () );
331331
332332 $ data = $ response ->get_data ();
333333 $ this ->assertCount ( 7 , $ data , 'Response should contain all fields. ' );
@@ -353,7 +353,7 @@ public function test_get_item_with_selected_fields(): void {
353353 add_filter ( 'rest_post_dispatch ' , 'rest_filter_response_fields ' , 10 , 3 );
354354 $ response = apply_filters ( 'rest_post_dispatch ' , $ response , $ this ->server , $ request );
355355
356- $ this ->assertEquals ( 200 , $ response ->get_status () );
356+ $ this ->assertSame ( 200 , $ response ->get_status () );
357357
358358 $ data = $ response ->get_data ();
359359 $ this ->assertCount ( 2 , $ data , 'Response should only contain the requested fields. ' );
@@ -373,7 +373,7 @@ public function test_get_item_with_embed_context(): void {
373373 add_filter ( 'rest_post_dispatch ' , 'rest_filter_response_fields ' , 10 , 3 );
374374 $ response = apply_filters ( 'rest_post_dispatch ' , $ response , $ this ->server , $ request );
375375
376- $ this ->assertEquals ( 200 , $ response ->get_status () );
376+ $ this ->assertSame ( 200 , $ response ->get_status () );
377377
378378 $ data = $ response ->get_data ();
379379 $ this ->assertCount ( 3 , $ data , 'Response should only contain the fields for embed context. ' );
@@ -391,7 +391,7 @@ public function test_get_item_not_found(): void {
391391 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities/non/existent ' );
392392 $ response = $ this ->server ->dispatch ( $ request );
393393
394- $ this ->assertEquals ( 404 , $ response ->get_status () );
394+ $ this ->assertSame ( 404 , $ response ->get_status () );
395395
396396 $ data = $ response ->get_data ();
397397 $ this ->assertSame ( 'rest_ability_not_found ' , $ data ['code ' ] );
@@ -406,7 +406,7 @@ public function test_get_item_not_show_in_rest(): void {
406406 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities/test/not-show-in-rest ' );
407407 $ response = $ this ->server ->dispatch ( $ request );
408408
409- $ this ->assertEquals ( 404 , $ response ->get_status () );
409+ $ this ->assertSame ( 404 , $ response ->get_status () );
410410
411411 $ data = $ response ->get_data ();
412412 $ this ->assertSame ( 'rest_ability_not_found ' , $ data ['code ' ] );
@@ -484,7 +484,7 @@ public function test_get_items_permission_denied(): void {
484484 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities ' );
485485 $ response = $ this ->server ->dispatch ( $ request );
486486
487- $ this ->assertEquals ( 401 , $ response ->get_status () );
487+ $ this ->assertSame ( 401 , $ response ->get_status () );
488488 }
489489
490490 /**
@@ -497,15 +497,15 @@ public function test_pagination_headers(): void {
497497 $ request ->set_param ( 'per_page ' , 10 );
498498 $ response = $ this ->server ->dispatch ( $ request );
499499
500- $ this ->assertEquals ( 200 , $ response ->get_status () );
500+ $ this ->assertSame ( 200 , $ response ->get_status () );
501501
502502 $ headers = $ response ->get_headers ();
503503 $ this ->assertArrayHasKey ( 'X-WP-Total ' , $ headers );
504504 $ this ->assertArrayHasKey ( 'X-WP-TotalPages ' , $ headers );
505505
506506 $ total_abilities = count ( wp_get_abilities () ) - 1 ; // Exclude the one that doesn't show in REST.
507- $ this ->assertSame ( $ total_abilities , ( int ) $ headers ['X-WP-Total ' ] );
508- $ this ->assertEquals ( ceil ( $ total_abilities / 10 ), ( int ) $ headers ['X-WP-TotalPages ' ] );
507+ $ this ->assertSame ( ( string ) $ total_abilities , $ headers ['X-WP-Total ' ] );
508+ $ this ->assertSame ( ( string ) ceil ( $ total_abilities / 10 ), $ headers ['X-WP-TotalPages ' ] );
509509 }
510510
511511 /**
@@ -587,7 +587,7 @@ public function test_collection_params(): void {
587587 $ request ->set_param ( 'page ' , 2 );
588588 $ response = $ this ->server ->dispatch ( $ request );
589589
590- $ this ->assertEquals ( 200 , $ response ->get_status () );
590+ $ this ->assertSame ( 200 , $ response ->get_status () );
591591 $ data = $ response ->get_data ();
592592 $ this ->assertCount ( 5 , $ data );
593593
@@ -725,7 +725,7 @@ public function test_ability_name_with_valid_special_characters(): void {
725725
726726 wp_unregister_ability ( 'test-hyphen/ability ' );
727727
728- $ this ->assertEquals ( 200 , $ response ->get_status () );
728+ $ this ->assertSame ( 200 , $ response ->get_status () );
729729 }
730730
731731 /**
@@ -759,7 +759,7 @@ public function test_ability_name_with_invalid_special_characters( string $name
759759 $ request = new WP_REST_Request ( 'GET ' , '/wp-abilities/v1/abilities/ ' . $ name );
760760 $ response = $ this ->server ->dispatch ( $ request );
761761 // Should return 404 as the regex pattern won't match
762- $ this ->assertEquals ( 404 , $ response ->get_status () );
762+ $ this ->assertSame ( 404 , $ response ->get_status () );
763763 }
764764
765765 /**
@@ -776,7 +776,7 @@ public function test_extremely_long_ability_names(): void {
776776 $ response = $ this ->server ->dispatch ( $ request );
777777
778778 // Should return 404 as ability doesn't exist
779- $ this ->assertEquals ( 404 , $ response ->get_status () );
779+ $ this ->assertSame ( 404 , $ response ->get_status () );
780780 }
781781
782782 /**
@@ -833,7 +833,7 @@ public function test_filter_by_category(): void {
833833 $ request ->set_param ( 'category ' , 'math ' );
834834 $ response = $ this ->server ->dispatch ( $ request );
835835
836- $ this ->assertEquals ( 200 , $ response ->get_status () );
836+ $ this ->assertSame ( 200 , $ response ->get_status () );
837837
838838 $ data = $ response ->get_data ();
839839 $ this ->assertIsArray ( $ data );
@@ -865,7 +865,7 @@ public function test_filter_by_nonexistent_category(): void {
865865 $ request ->set_param ( 'category ' , 'nonexistent ' );
866866 $ response = $ this ->server ->dispatch ( $ request );
867867
868- $ this ->assertEquals ( 200 , $ response ->get_status () );
868+ $ this ->assertSame ( 200 , $ response ->get_status () );
869869
870870 $ data = $ response ->get_data ();
871871 $ this ->assertIsArray ( $ data );
0 commit comments