2121
2222class AppHandlerIntegrationTest extends TestCase
2323{
24- public function testInstantiation ()
24+ public function test_Instantiation ()
2525 {
2626 $ this ->assertInstanceOf (AppHandler::class, $ this ->app ());
2727 }
2828
29- public function testConfig_ReturnsSetupEntry ()
29+ public function test_Config_ReturnsSetupEntry ()
3030 {
3131 $ app = $ this ->app ();
3232 $ this ->assertInstanceOf (Container \Setup \Entry::class, $ app ->config ('test ' ));
3333 }
3434
35- public function testRoutingContainerIntegration ()
35+ public function test_RoutingContainerIntegration ()
3636 {
3737 $ app = $ this ->app (['test ' => new Container \Records \Record \ValueRecord ('Hello World! ' )]);
3838 $ response = $ app ->handle (new Doubles \FakeServerRequest ());
3939 $ this ->assertSame ('//example.com/foo/bar: Hello World! ' , (string ) $ response ->getBody ());
4040 }
4141
42- public function testRepeatedHandleCallsWithMiddlewareProcessing_ReturnsEqualResponse ()
42+ public function test_RepeatedHandleCalls_WithMiddlewareProcessing_ReturnEqualResponse ()
4343 {
4444 $ app = $ this ->middlewareContextsApp ();
4545 $ request = new Doubles \FakeServerRequest ('GET ' , Doubles \FakeUri::fromString ('/test ' ));
@@ -50,13 +50,13 @@ public function testRepeatedHandleCallsWithMiddlewareProcessing_ReturnsEqualResp
5050 $ this ->assertEquals ($ response , $ app ->handle ($ request ));
5151 }
5252
53- public function testInstanceWithDefinedInternalContainerId_ThrowsException ()
53+ public function test_InstanceWithDefinedInternalContainerId_ThrowsException ()
5454 {
5555 $ this ->expectException (Container \Setup \Exception \OverwriteRuleException::class);
5656 $ this ->app ([AppHandler::ROUTER_ID => new Container \Records \Record \ValueRecord ('Hello World! ' )]);
5757 }
5858
59- public function testFallbackNotFoundRoute ()
59+ public function test_FallbackNotFoundRoute ()
6060 {
6161 $ app = $ this ->app ();
6262 $ app ->routeFound = false ;
@@ -67,7 +67,7 @@ public function testFallbackNotFoundRoute()
6767 $ this ->assertSame ($ app ->notFoundResponse , $ response );
6868 }
6969
70- public function testShutdownRegisteredOnProduction ()
70+ public function test_ShutdownRegistered_OnProduction ()
7171 {
7272 Fixtures \ShutdownState::reset ();
7373 Fixtures \ShutdownState::$ override = true ;
@@ -80,7 +80,7 @@ public function testShutdownRegisteredOnProduction()
8080 $ this ->assertTrue (Fixtures \ShutdownState::$ outputBufferCleared );
8181 }
8282
83- public function testShutdownNotRegisteredOnDevelopment ()
83+ public function test_ShutdownNotRegistered_OnDevelopment ()
8484 {
8585 Fixtures \ShutdownState::reset ();
8686 Fixtures \ShutdownState::$ override = true ;
@@ -90,20 +90,19 @@ public function testShutdownNotRegisteredOnDevelopment()
9090 $ this ->assertFalse (is_callable (Fixtures \ShutdownState::$ callback ));
9191 }
9292
93- private function app (array $ records = [], bool $ secure = false ): Doubles \MockedAppHandler
93+ private function app (array $ records = []): Doubles \MockedAppHandler
9494 {
95- $ setup = $ secure ? new Container \Setup \Build \ValidatedBuild ($ records ) : new Container \Setup \Build ($ records );
96- return new Doubles \MockedAppHandler ($ setup );
95+ return new Doubles \MockedAppHandler (new Container \Setup \Build ($ records ));
9796 }
9897
9998 private function middlewareContextsApp (): Doubles \MockedAppHandler
10099 {
101100 $ app = $ this ->app ();
102101 $ app ->config ('test ' )->value ('MAIN ' );
103102 $ app ->middleware ('one ' )->value (new Doubles \FakeMiddleware ('outerContext ' ));
104- $ app ->middleware ('two ' )->callback (function ( $ c ) {
105- return new Doubles \FakeMiddleware ($ c ->get ('one ' )->inContext ? 'innerContext ' : '--- error --- ' );
106- } );
103+ $ app ->middleware ('two ' )->callback (
104+ fn ( $ c ) => new Doubles \FakeMiddleware ($ c ->get ('one ' )->inContext ? 'innerContext ' : '--- error --- ' )
105+ );
107106
108107 return $ app ;
109108 }
0 commit comments