77use FrameworkX \Container ;
88use FrameworkX \ErrorHandler ;
99use FrameworkX \Io \MiddlewareHandler ;
10- use FrameworkX \Io \ReactiveHandler ;
1110use FrameworkX \Io \RouteHandler ;
11+ use FrameworkX \Runner \HttpServerRunner ;
1212use FrameworkX \Tests \Fixtures \InvalidAbstract ;
1313use FrameworkX \Tests \Fixtures \InvalidConstructorInt ;
1414use FrameworkX \Tests \Fixtures \InvalidConstructorIntersection ;
@@ -92,26 +92,26 @@ public function testConstructWithContainerMockAssignsDefaultHandlersFromContaine
9292 $ errorHandler = new ErrorHandler ();
9393 $ routeHandler = $ this ->createMock (RouteHandler::class);
9494
95- $ sapi = $ this ->createMock (ReactiveHandler ::class);
95+ $ runner = $ this ->createMock (HttpServerRunner ::class);
9696
9797 $ container = $ this ->createMock (Container::class);
9898 $ container ->expects ($ this ->exactly (3 ))->method ('getObject ' )->willReturnMap ([
9999 [AccessLogHandler::class, $ accessLogHandler ],
100100 [ErrorHandler::class, $ errorHandler ],
101101 [RouteHandler::class, $ routeHandler ],
102102 ]);
103- $ container ->expects ($ this ->once ())->method ('getSapi ' )->willReturn ($ sapi );
103+ $ container ->expects ($ this ->once ())->method ('getRunner ' )->willReturn ($ runner );
104104 assert ($ container instanceof Container);
105105
106106 $ app = new App ($ container );
107107
108- $ ref = new \ReflectionProperty ($ app , 'sapi ' );
108+ $ ref = new \ReflectionProperty ($ app , 'runner ' );
109109 if (PHP_VERSION_ID < 80100 ) {
110110 $ ref ->setAccessible (true );
111111 }
112112 $ ret = $ ref ->getValue ($ app );
113113
114- $ this ->assertSame ($ sapi , $ ret );
114+ $ this ->assertSame ($ runner , $ ret );
115115
116116 $ ref = new ReflectionProperty ($ app , 'handler ' );
117117 if (PHP_VERSION_ID < 80100 ) {
@@ -138,13 +138,13 @@ public function testConstructWithContainerInstanceAssignsDefaultHandlersAndConta
138138 $ container = new Container ([]);
139139 $ app = new App ($ container );
140140
141- $ ref = new \ReflectionProperty ($ app , 'sapi ' );
141+ $ ref = new \ReflectionProperty ($ app , 'runner ' );
142142 if (PHP_VERSION_ID < 80100 ) {
143143 $ ref ->setAccessible (true );
144144 }
145145 $ ret = $ ref ->getValue ($ app );
146146
147- $ this ->assertSame ($ container ->getSapi (), $ ret );
147+ $ this ->assertSame ($ container ->getRunner (), $ ret );
148148
149149 $ ref = new ReflectionProperty ($ app , 'handler ' );
150150 if (PHP_VERSION_ID < 80100 ) {
@@ -893,39 +893,39 @@ public function testConstructWithRouteHandlerClassNameFollowedByMiddlewareThrows
893893 new App (RouteHandler::class, $ middleware );
894894 }
895895
896- public function testConstructWithContainerWithListenAddressWillPassListenAddressToReactiveHandler (): void
896+ public function testConstructWithContainerWithListenAddressWillPassListenAddressToHttpServerRunner (): void
897897 {
898898 $ container = new Container ([
899899 'X_LISTEN ' => '0.0.0.0:8081 '
900900 ]);
901901
902902 $ app = new App ($ container );
903903
904- // $sapi = $app->sapi ;
905- $ ref = new \ReflectionProperty ($ app , 'sapi ' );
904+ // $runner = $app->runner ;
905+ $ ref = new \ReflectionProperty ($ app , 'runner ' );
906906 if (PHP_VERSION_ID < 80100 ) {
907907 $ ref ->setAccessible (true );
908908 }
909- $ sapi = $ ref ->getValue ($ app );
910- assert ($ sapi instanceof ReactiveHandler );
909+ $ runner = $ ref ->getValue ($ app );
910+ assert ($ runner instanceof HttpServerRunner );
911911
912- // $listenAddress = $sapi ->listenAddress;
913- $ ref = new \ReflectionProperty ($ sapi , 'listenAddress ' );
912+ // $listenAddress = $runner ->listenAddress;
913+ $ ref = new \ReflectionProperty ($ runner , 'listenAddress ' );
914914 if (PHP_VERSION_ID < 80100 ) {
915915 $ ref ->setAccessible (true );
916916 }
917- $ listenAddress = $ ref ->getValue ($ sapi );
917+ $ listenAddress = $ ref ->getValue ($ runner );
918918
919919 $ this ->assertEquals ('0.0.0.0:8081 ' , $ listenAddress );
920920 }
921921
922- public function testRunWillExecuteRunOnSapiHandlerFromContainer (): void
922+ public function testRunWillInvokeRunnerFromContainer (): void
923923 {
924- $ sapi = $ this ->createMock (ReactiveHandler ::class);
925- $ sapi ->expects ($ this ->once ())->method ('run ' );
924+ $ runner = $ this ->createMock (HttpServerRunner ::class);
925+ $ runner ->expects ($ this ->once ())->method ('__invoke ' );
926926
927927 $ container = new Container ([
928- ReactiveHandler ::class => $ sapi
928+ HttpServerRunner ::class => $ runner
929929 ]);
930930
931931 $ app = new App ($ container );
0 commit comments