2020
2121use function assert ;
2222use function bin2hex ;
23+ use function implode ;
2324use function iterator_to_array ;
2425use function random_bytes ;
2526use function React \Promise \resolve ;
@@ -39,7 +40,8 @@ public function handle(): void
3940 $ eventLoopBridge = new EventLoopBridge ($ loop );
4041 $ pool = new Infinite ($ loop , $ eventLoopBridge , 10 );
4142 $ stub = new Psr15MiddlewareStub ();
42- $ middleware = new ReactMiddleware (new StreamFactory ($ eventLoopBridge ), $ pool , $ stub , $ loop , $ eventLoopBridge );
43+ $ anotherStub = new AnotherPsr15MiddlewareStub ();
44+ $ middleware = new ReactMiddleware ($ loop , $ eventLoopBridge , new StreamFactory ($ eventLoopBridge ), $ pool , $ stub , $ stub , $ anotherStub );
4345 $ request = new ServerRequest ('GET ' , 'https://example.com/ ' );
4446 $ request = $ request ->withAttribute ('body ' , $ rnd );
4547
@@ -66,7 +68,7 @@ static function (ServerRequestInterface $request): PromiseInterface {
6668 Info::SIZE => 1 ,
6769 ], iterator_to_array ($ pool ->info ()));
6870
69- $ response = $ this ->await ($ promise , $ loop , 3.3 );
71+ $ response = $ this ->await ($ promise , $ loop , 9.9 );
7072 assert ($ response instanceof ResponseInterface);
7173
7274 self ::assertSame ([
@@ -79,7 +81,10 @@ static function (ServerRequestInterface $request): PromiseInterface {
7981
8082 self ::assertSame (666 , $ response ->getStatusCode ());
8183 self ::assertSame ($ rnd , $ response ->getBody ()->getContents ());
82- self ::assertSame (Psr15MiddlewareStub::class, $ response ->getHeaderLine ('__CLASS__ ' ));
84+ self ::assertSame (
85+ implode (', ' , [AnotherPsr15MiddlewareStub::class, Psr15MiddlewareStub::class, Psr15MiddlewareStub::class]),
86+ $ response ->getHeaderLine ('__CLASS__ ' )
87+ );
8388
8489 $ middleware ->__destruct ();
8590
0 commit comments