@@ -77,21 +77,21 @@ public function testCanGetDifferentModes(): void
7777
7878 Http::setMode (Http::MODE_TYPE_PRODUCTION );
7979
80- $ this ->assertEquals (Http::MODE_TYPE_PRODUCTION , Http::getMode ());
80+ $ this ->assertSame (Http::MODE_TYPE_PRODUCTION , Http::getMode ());
8181 $ this ->assertTrue (Http::isProduction ());
8282 $ this ->assertFalse (Http::isDevelopment ());
8383 $ this ->assertFalse (Http::isStage ());
8484
8585 Http::setMode (Http::MODE_TYPE_DEVELOPMENT );
8686
87- $ this ->assertEquals (Http::MODE_TYPE_DEVELOPMENT , Http::getMode ());
87+ $ this ->assertSame (Http::MODE_TYPE_DEVELOPMENT , Http::getMode ());
8888 $ this ->assertFalse (Http::isProduction ());
8989 $ this ->assertTrue (Http::isDevelopment ());
9090 $ this ->assertFalse (Http::isStage ());
9191
9292 Http::setMode (Http::MODE_TYPE_STAGE );
9393
94- $ this ->assertEquals (Http::MODE_TYPE_STAGE , Http::getMode ());
94+ $ this ->assertSame (Http::MODE_TYPE_STAGE , Http::getMode ());
9595 $ this ->assertFalse (Http::isProduction ());
9696 $ this ->assertFalse (Http::isDevelopment ());
9797 $ this ->assertTrue (Http::isStage ());
@@ -136,7 +136,7 @@ public function testCanExecuteRoute(): void
136136 $ result = \ob_get_contents ();
137137 \ob_end_clean ();
138138
139- $ this ->assertEquals ('x-def-y-def ' , $ result );
139+ $ this ->assertSame ('x-def-y-def ' , $ result );
140140 }
141141
142142 public function testCanExecuteRouteWithParams (): void
@@ -191,7 +191,7 @@ public function testCanExecuteRouteWithParams(): void
191191 $ result = \ob_get_contents ();
192192 \ob_end_clean ();
193193 $ resource = $ context ->get ('rand ' );
194- $ this ->assertEquals ($ resource . '-param-x-param-y ' , $ result );
194+ $ this ->assertSame ($ resource . '-param-x-param-y ' , $ result );
195195 }
196196
197197 public function testCanExecuteRouteWithParamsWithError (): void
@@ -240,7 +240,7 @@ public function testCanExecuteRouteWithParamsWithError(): void
240240 $ result = \ob_get_contents ();
241241 \ob_end_clean ();
242242
243- $ this ->assertEquals ('error: Invalid `x` param: Value must be a valid string and no longer than 1 chars ' , $ result );
243+ $ this ->assertSame ('error: Invalid `x` param: Value must be a valid string and no longer than 1 chars ' , $ result );
244244 }
245245
246246 public function testCanExecuteRouteWithParamsWithHooks (): void
@@ -345,7 +345,7 @@ public function testCanExecuteRouteWithParamsWithHooks(): void
345345 $ result = \ob_get_contents ();
346346 \ob_end_clean ();
347347
348- $ this ->assertEquals ('init- ' . $ resource . '-(init-api)-param-x-param-y-(shutdown-api)-shutdown ' , $ result );
348+ $ this ->assertSame ('init- ' . $ resource . '-(init-api)-param-x-param-y-(shutdown-api)-shutdown ' , $ result );
349349
350350 $ context = clone $ this ->context ;
351351
@@ -376,7 +376,7 @@ public function testCanExecuteRouteWithParamsWithHooks(): void
376376 $ result = \ob_get_contents ();
377377 \ob_end_clean ();
378378
379- $ this ->assertEquals ('init- ' . $ resource . '-(init-homepage)-param-x*param-y-(shutdown-homepage)-shutdown ' , $ result );
379+ $ this ->assertSame ('init- ' . $ resource . '-(init-homepage)-param-x*param-y-(shutdown-homepage)-shutdown ' , $ result );
380380 }
381381
382382 public function testCanAddAndExecuteHooks ()
@@ -420,7 +420,7 @@ public function testCanAddAndExecuteHooks()
420420 $ this ->http ->run ($ context );
421421 $ result = \ob_get_contents ();
422422 \ob_end_clean ();
423- $ this ->assertEquals ('(init)-x-def-(shutdown) ' , $ result );
423+ $ this ->assertSame ('(init)-x-def-(shutdown) ' , $ result );
424424
425425 // Default Params
426426 $ route = $ this ->http ->addRoute ('GET ' , '/path-4 ' );
@@ -450,7 +450,7 @@ public function testCanAddAndExecuteHooks()
450450 $ result = \ob_get_contents ();
451451 \ob_end_clean ();
452452
453- $ this ->assertEquals ('x-def ' , $ result );
453+ $ this ->assertSame ('x-def ' , $ result );
454454 }
455455
456456 public function testAllowRouteOverrides ()
@@ -468,7 +468,7 @@ public function testAllowRouteOverrides()
468468 $ this ->fail ('Failed to throw exception ' );
469469 } catch (\Exception $ e ) {
470470 // Threw exception as expected
471- $ this ->assertEquals ('Route for (GET:) already registered. ' , $ e ->getMessage ());
471+ $ this ->assertSame ('Route for (GET:) already registered. ' , $ e ->getMessage ());
472472 }
473473
474474 // Test success
@@ -533,7 +533,7 @@ public function testCanHookThrowExceptions()
533533 $ result = \ob_get_contents ();
534534 \ob_end_clean ();
535535
536- $ this ->assertEquals ('error: Param "y" is not optional. ' , $ result );
536+ $ this ->assertSame ('error: Param "y" is not optional. ' , $ result );
537537
538538 $ context = clone $ this ->context ;
539539
@@ -555,7 +555,7 @@ public function testCanHookThrowExceptions()
555555 $ result = \ob_get_contents ();
556556 \ob_end_clean ();
557557
558- $ this ->assertEquals ('(init)-y-def-x-def-(shutdown) ' , $ result );
558+ $ this ->assertSame ('(init)-y-def-x-def-(shutdown) ' , $ result );
559559 }
560560
561561 public function providerRouteMatching (): array
@@ -606,7 +606,7 @@ public function testCanMatchRoute(string $method, string $path, ?string $url = n
606606 $ _SERVER ['REQUEST_URI ' ] = $ url ;
607607
608608 $ route = $ this ->http ->match (new Request ());
609- $ this ->assertEquals ($ expected , $ route );
609+ $ this ->assertSame ($ expected , $ route );
610610 }
611611
612612 public function testMatchWithNullPath (): void
@@ -619,7 +619,7 @@ public function testMatchWithNullPath(): void
619619 $ _SERVER ['REQUEST_URI ' ] = '?param=1 ' ; // This will cause parse_url to return null for PATH component
620620
621621 $ matched = $ this ->http ->match (new Request ());
622- $ this ->assertEquals ($ expected , $ matched );
622+ $ this ->assertSame ($ expected , $ matched );
623623 }
624624
625625 public function testMatchWithEmptyPath (): void
@@ -632,7 +632,7 @@ public function testMatchWithEmptyPath(): void
632632 $ _SERVER ['REQUEST_URI ' ] = 'https://example.com ' ; // No path component
633633
634634 $ matched = $ this ->http ->match (new Request ());
635- $ this ->assertEquals ($ expected , $ matched );
635+ $ this ->assertSame ($ expected , $ matched );
636636 }
637637
638638 public function testMatchWithMalformedURL (): void
@@ -645,7 +645,7 @@ public function testMatchWithMalformedURL(): void
645645 $ _SERVER ['REQUEST_URI ' ] = '#fragment ' ; // Malformed scheme
646646
647647 $ matched = $ this ->http ->match (new Request ());
648- $ this ->assertEquals ($ expected , $ matched );
648+ $ this ->assertSame ($ expected , $ matched );
649649 }
650650
651651 public function testMatchWithOnlyQueryString (): void
@@ -658,7 +658,7 @@ public function testMatchWithOnlyQueryString(): void
658658 $ _SERVER ['REQUEST_URI ' ] = '?param=value ' ; // Only query string, no path
659659
660660 $ matched = $ this ->http ->match (new Request ());
661- $ this ->assertEquals ($ expected , $ matched );
661+ $ this ->assertSame ($ expected , $ matched );
662662 }
663663
664664 public function testNoMismatchRoute (): void
@@ -697,8 +697,8 @@ public function testNoMismatchRoute(): void
697697
698698 $ this ->http ->run ($ context );
699699
700- $ this ->assertEquals ($ _SERVER ['REQUEST_METHOD ' ], $ context ->get ('route ' )->getMethod ());
701- $ this ->assertEquals ($ _SERVER ['REQUEST_URI ' ], $ context ->get ('route ' )->getPath ());
700+ $ this ->assertSame ($ _SERVER ['REQUEST_METHOD ' ], $ context ->get ('route ' )->getMethod ());
701+ $ this ->assertSame ($ _SERVER ['REQUEST_URI ' ], $ context ->get ('route ' )->getPath ());
702702 }
703703 }
704704
@@ -778,15 +778,15 @@ public function testWildcardRoute(): void
778778 $ result = \ob_get_contents ();
779779 \ob_end_clean ();
780780
781- $ this ->assertEquals ('HELLO ' , $ result );
781+ $ this ->assertSame ('HELLO ' , $ result );
782782
783783 \ob_start ();
784784 $ context ->get ('request ' )->setMethod ('OPTIONS ' );
785785 $ this ->http ->run ($ context );
786786 $ result = \ob_get_contents ();
787787 \ob_end_clean ();
788788
789- $ this ->assertEquals ('' , $ result );
789+ $ this ->assertSame ('' , $ result );
790790
791791 $ _SERVER ['REQUEST_METHOD ' ] = $ method ;
792792 $ _SERVER ['REQUEST_URI ' ] = $ uri ;
@@ -811,7 +811,7 @@ public function testCallableStringParametersNotExecuted(): void
811811 $ result = \ob_get_contents ();
812812 \ob_end_clean ();
813813
814- $ this ->assertEquals ('callback-value: phpinfo ' , $ result );
814+ $ this ->assertSame ('callback-value: phpinfo ' , $ result );
815815
816816 // Test with request parameter that is a callable string
817817 $ route2 = new Route ('GET ' , '/test-callable-string-param ' );
@@ -830,7 +830,7 @@ public function testCallableStringParametersNotExecuted(): void
830830 $ result = \ob_get_contents ();
831831 \ob_end_clean ();
832832
833- $ this ->assertEquals ('func-value: system ' , $ result );
833+ $ this ->assertSame ('func-value: system ' , $ result );
834834
835835 // Test callable closure still works
836836 $ route3 = new Route ('GET ' , '/test-callable-closure ' );
@@ -849,6 +849,6 @@ public function testCallableStringParametersNotExecuted(): void
849849 $ result = \ob_get_contents ();
850850 \ob_end_clean ();
851851
852- $ this ->assertEquals ('generated: generated-value ' , $ result );
852+ $ this ->assertSame ('generated: generated-value ' , $ result );
853853 }
854854}
0 commit comments