1212
1313namespace chillerlan \HTTPTest \Psr15 ;
1414
15- use chillerlan \HTTP \Psr17 ;
16- use chillerlan \HTTP \Psr15 \{ EmptyResponseHandler , PriorityQueueRequestHandler } ;
15+ use chillerlan \HTTP \{ Psr15 \ QueueRunner , Psr17 , Psr7 } ;
16+ use chillerlan \HTTP \Psr15 \PriorityQueueRequestHandler ;
1717use chillerlan \HTTP \Psr15 \Middleware \{MiddlewareException , PriorityMiddleware };
1818use PHPUnit \Framework \TestCase ;
1919use Psr \Http \Message \{ResponseInterface , ServerRequestInterface };
@@ -48,9 +48,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
4848 // execute it:
4949 $ response = $ handler ->handle (Psr17 \create_server_request_from_globals ());
5050
51- // highest priority shall go out first
51+ // highest priority shall be processed first and go out last
5252 $ this ->assertSame (
53- ['X-Priority-3 ' , 'X-Priority-2 ' , 'X-Priority-1 ' , 'X-Priority-none1 ' , 'X-Priority-none0 ' ],
53+ ['X-Priority-none1 ' , 'X-Priority-none0 ' , 'X-Priority-1 ' , 'X-Priority-2 ' , 'X-Priority-3 ' ],
5454 array_keys ($ response ->getHeaders ())
5555 );
5656 }
@@ -75,7 +75,7 @@ public function testNestedHandler(){
7575 $ response = $ handler ->handle (Psr17 \create_server_request_from_globals ());
7676
7777 $ this ->assertSame (
78- ['X-Priority-4 ' , 'X-Priority-3 ' , 'X-Priority-33 ' , 'X-Priority-22 ' , 'X-Priority-11 ' , 'X-Priority-1 ' ],
78+ ['X-Priority-1 ' , 'X-Priority-11 ' , 'X-Priority-22 ' , 'X-Priority-33 ' , 'X-Priority-3 ' , 'X-Priority-4 ' ],
7979 array_keys ($ response ->getHeaders ())
8080 );
8181 }
0 commit comments