12
12
13
13
namespace chillerlan \HTTPTest \Psr15 ;
14
14
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 ;
17
17
use chillerlan \HTTP \Psr15 \Middleware \{MiddlewareException , PriorityMiddleware };
18
18
use PHPUnit \Framework \TestCase ;
19
19
use Psr \Http \Message \{ResponseInterface , ServerRequestInterface };
@@ -48,9 +48,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
48
48
// execute it:
49
49
$ response = $ handler ->handle (Psr17 \create_server_request_from_globals ());
50
50
51
- // highest priority shall go out first
51
+ // highest priority shall be processed first and go out last
52
52
$ 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 ' ],
54
54
array_keys ($ response ->getHeaders ())
55
55
);
56
56
}
@@ -75,7 +75,7 @@ public function testNestedHandler(){
75
75
$ response = $ handler ->handle (Psr17 \create_server_request_from_globals ());
76
76
77
77
$ 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 ' ],
79
79
array_keys ($ response ->getHeaders ())
80
80
);
81
81
}
0 commit comments