File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1227,4 +1227,35 @@ public function testGetHeaderLineContentType(): void
12271227
12281228 $ this ->assertSame ('text/html; charset=UTF-8 ' , $ response ->getHeaderLine ('Content-Type ' ));
12291229 }
1230+
1231+ public function testHTTPversionAsString (): void
1232+ {
1233+ $ this ->request ->request ('POST ' , '/post ' , [
1234+ 'version ' => '1.0 ' ,
1235+ ]);
1236+
1237+ $ options = $ this ->request ->curl_options ;
1238+
1239+ $ this ->assertArrayHasKey (CURLOPT_HTTP_VERSION , $ options );
1240+ $ this ->assertSame (CURL_HTTP_VERSION_1_0 , $ options [CURLOPT_HTTP_VERSION ]);
1241+
1242+ $ this ->request ->request ('POST ' , '/post ' , [
1243+ 'version ' => '1.1 ' ,
1244+ ]);
1245+
1246+ $ options = $ this ->request ->curl_options ;
1247+
1248+ $ this ->assertArrayHasKey (CURLOPT_HTTP_VERSION , $ options );
1249+ $ this ->assertSame (CURL_HTTP_VERSION_1_1 , $ options [CURLOPT_HTTP_VERSION ]);
1250+
1251+ $ this ->request ->request ('POST ' , '/post ' , [
1252+ 'version ' => '2.0 ' ,
1253+ ]);
1254+
1255+ $ options = $ this ->request ->curl_options ;
1256+
1257+ $ this ->assertArrayHasKey (CURLOPT_HTTP_VERSION , $ options );
1258+ $ this ->assertSame (CURL_HTTP_VERSION_2_0 , $ options [CURLOPT_HTTP_VERSION ]);
1259+
1260+ }
12301261}
You can’t perform that action at this time.
0 commit comments