File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1313 "name" : " kpicaza"
1414 }
1515 ],
16- "repositories" : [
17- {
18- "type" : " git" ,
19- "url" : " https://github.com/kpicaza/antidot-framework"
20- }
21- ],
2216 "require" : {
2317 "php" : " >=8.1" ,
2418 "antidot-fw/framework" : " 3.x.x-dev" ,
2519 "nyholm/psr7" : " ^1.4" ,
2620 "nyholm/psr7-server" : " ^1.0" ,
21+ "psr/http-server-middleware" : " ^1.0" ,
2722 "react/http" : " ^1.5" ,
2823 "symfony/runtime" : " ^5.3"
2924 },
Original file line number Diff line number Diff line change 88use Laminas \HttpHandlerRunner \Emitter \SapiEmitter ;
99use Nyholm \Psr7 \Factory \Psr17Factory ;
1010use Nyholm \Psr7Server \ServerRequestCreator ;
11+ use React \EventLoop \Loop ;
1112
1213final class SyncRunner
1314{
@@ -34,6 +35,9 @@ public function run(): int
3435 $ this ->application ->handle ($ this ->responseFactory ->fromGlobals ())
3536 );
3637
38+ $ loop = Loop::get ();
39+ $ loop ->run ();
40+
3741 return 0 ;
3842 }
3943}
Original file line number Diff line number Diff line change 1111use Antidot \Runtime \SyncRunner ;
1212use Laminas \HttpHandlerRunner \Emitter \SapiEmitter ;
1313use PHPUnit \Framework \TestCase ;
14+ use Psr \Container \ContainerInterface ;
1415use Psr \Http \Message \ResponseInterface ;
16+ use Psr \Http \Server \MiddlewareInterface ;
1517
1618final class SyncRunnerTest extends TestCase
1719{
1820 public function testItShouldEmitApplicationResponse (): void
1921 {
20- $ middlewareFactory = $ this ->createMock (MiddlewareFactory::class);
22+ $ container = $ this ->createMock (ContainerInterface::class);
23+ $ container ->expects (self ::once ())
24+ ->method ('get ' )
25+ ->with ('test_middleware ' )
26+ ->willReturn ($ this ->createMock (MiddlewareInterface::class));
27+ $ middlewareFactory = new MiddlewareFactory ($ container );
2128 $ sapi = $ this ->createMock (SapiEmitter::class);
2229 $ sapi ->expects (self ::once ())
2330 ->method ('emit ' )
You can’t perform that action at this time.
0 commit comments