@@ -1443,7 +1443,7 @@ public function testRequestChunkedTransferEncodingRequestWillEmitDecodedDataEven
14431443
14441444 $ this ->connection ->emit ('data ' , array ($ data ));
14451445
1446- $ this ->assertFalse ( $ requestValidation ->hasHeader ('Transfer-Encoding ' ));
1446+ $ this ->assertEquals ( ' chunked ' , $ requestValidation ->getHeaderLine ('Transfer-Encoding ' ));
14471447 }
14481448
14491449 public function testRequestChunkedTransferEncodingWithAdditionalDataWontBeEmitted ()
@@ -1508,12 +1508,14 @@ public function testRequestChunkedTransferEncodingHeaderCanBeUpperCase()
15081508 $ endEvent = $ this ->expectCallableOnce ();
15091509 $ closeEvent = $ this ->expectCallableOnce ();
15101510 $ errorEvent = $ this ->expectCallableNever ();
1511+ $ requestValidation = null ;
15111512
1512- $ server = new StreamingServer (function (ServerRequestInterface $ request ) use ($ dataEvent , $ endEvent , $ closeEvent , $ errorEvent ) {
1513+ $ server = new StreamingServer (function (ServerRequestInterface $ request ) use ($ dataEvent , $ endEvent , $ closeEvent , $ errorEvent, & $ requestValidation ) {
15131514 $ request ->getBody ()->on ('data ' , $ dataEvent );
15141515 $ request ->getBody ()->on ('end ' , $ endEvent );
15151516 $ request ->getBody ()->on ('close ' , $ closeEvent );
15161517 $ request ->getBody ()->on ('error ' , $ errorEvent );
1518+ $ requestValidation = $ request ;
15171519 });
15181520
15191521 $ server ->listen ($ this ->socket );
@@ -1528,6 +1530,7 @@ public function testRequestChunkedTransferEncodingHeaderCanBeUpperCase()
15281530 $ data .= "0 \r\n\r\n" ;
15291531
15301532 $ this ->connection ->emit ('data ' , array ($ data ));
1533+ $ this ->assertEquals ('CHUNKED ' , $ requestValidation ->getHeaderLine ('Transfer-Encoding ' ));
15311534 }
15321535
15331536 public function testRequestChunkedTransferEncodingCanBeMixedUpperAndLowerCase ()
@@ -1803,7 +1806,7 @@ public function testRequestContentLengthWillBeIgnoredIfTransferEncodingIsSet()
18031806 $ this ->connection ->emit ('data ' , array ($ data ));
18041807
18051808 $ this ->assertFalse ($ requestValidation ->hasHeader ('Content-Length ' ));
1806- $ this ->assertFalse ( $ requestValidation ->hasHeader ('Transfer-Encoding ' ));
1809+ $ this ->assertEquals ( ' chunked ' , $ requestValidation ->getHeaderLine ('Transfer-Encoding ' ));
18071810 }
18081811
18091812 public function testRequestInvalidContentLengthWillBeIgnoreddIfTransferEncodingIsSet ()
@@ -1841,7 +1844,7 @@ public function testRequestInvalidContentLengthWillBeIgnoreddIfTransferEncodingI
18411844 $ this ->connection ->emit ('data ' , array ($ data ));
18421845
18431846 $ this ->assertFalse ($ requestValidation ->hasHeader ('Content-Length ' ));
1844- $ this ->assertFalse ( $ requestValidation ->hasHeader ('Transfer-Encoding ' ));
1847+ $ this ->assertEquals ( ' chunked ' , $ requestValidation ->getHeaderLine ('Transfer-Encoding ' ));
18451848 }
18461849
18471850 public function testRequestInvalidNonIntegerContentLengthWillEmitServerErrorAndSendResponse ()
0 commit comments