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 13
13
"name" : " kpicaza"
14
14
}
15
15
],
16
- "repositories" : [
17
- {
18
- "type" : " git" ,
19
- "url" : " https://github.com/kpicaza/antidot-framework"
20
- }
21
- ],
22
16
"require" : {
23
17
"php" : " >=8.1" ,
24
18
"antidot-fw/framework" : " 3.x.x-dev" ,
25
19
"nyholm/psr7" : " ^1.4" ,
26
20
"nyholm/psr7-server" : " ^1.0" ,
21
+ "psr/http-server-middleware" : " ^1.0" ,
27
22
"react/http" : " ^1.5" ,
28
23
"symfony/runtime" : " ^5.3"
29
24
},
Original file line number Diff line number Diff line change 8
8
use Laminas \HttpHandlerRunner \Emitter \SapiEmitter ;
9
9
use Nyholm \Psr7 \Factory \Psr17Factory ;
10
10
use Nyholm \Psr7Server \ServerRequestCreator ;
11
+ use React \EventLoop \Loop ;
11
12
12
13
final class SyncRunner
13
14
{
@@ -34,6 +35,9 @@ public function run(): int
34
35
$ this ->application ->handle ($ this ->responseFactory ->fromGlobals ())
35
36
);
36
37
38
+ $ loop = Loop::get ();
39
+ $ loop ->run ();
40
+
37
41
return 0 ;
38
42
}
39
43
}
Original file line number Diff line number Diff line change 11
11
use Antidot \Runtime \SyncRunner ;
12
12
use Laminas \HttpHandlerRunner \Emitter \SapiEmitter ;
13
13
use PHPUnit \Framework \TestCase ;
14
+ use Psr \Container \ContainerInterface ;
14
15
use Psr \Http \Message \ResponseInterface ;
16
+ use Psr \Http \Server \MiddlewareInterface ;
15
17
16
18
final class SyncRunnerTest extends TestCase
17
19
{
18
20
public function testItShouldEmitApplicationResponse (): void
19
21
{
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 );
21
28
$ sapi = $ this ->createMock (SapiEmitter::class);
22
29
$ sapi ->expects (self ::once ())
23
30
->method ('emit ' )
You can’t perform that action at this time.
0 commit comments