@@ -75,26 +75,24 @@ public function testGetRequest()
75
75
public function testHeadRequest ()
76
76
{
77
77
$ client = $ this ->getHttpClient (__FUNCTION__ );
78
- $ response = $ client ->request ('HEAD ' , 'http://localhost:8057 ' , [
78
+ $ response = $ client ->request ('HEAD ' , 'http://localhost:8057/head ' , [
79
79
'headers ' => ['Foo ' => 'baR ' ],
80
80
'user_data ' => $ data = new \stdClass (),
81
+ 'buffer ' => false ,
81
82
]);
82
83
83
84
$ this ->assertSame ([], $ response ->getInfo ('response_headers ' ));
84
- $ this ->assertSame ($ data , $ response ->getInfo ()['user_data ' ]);
85
85
$ this ->assertSame (200 , $ response ->getStatusCode ());
86
86
87
87
$ info = $ response ->getInfo ();
88
- $ this ->assertNull ($ info ['error ' ]);
89
- $ this ->assertSame (0 , $ info ['redirect_count ' ]);
90
88
$ this ->assertSame ('HTTP/1.1 200 OK ' , $ info ['response_headers ' ][0 ]);
91
89
$ this ->assertSame ('Host: localhost:8057 ' , $ info ['response_headers ' ][1 ]);
92
- $ this ->assertSame ('http://localhost:8057/ ' , $ info ['url ' ]);
93
90
94
91
$ headers = $ response ->getHeaders ();
95
92
96
93
$ this ->assertSame ('localhost:8057 ' , $ headers ['host ' ][0 ]);
97
94
$ this ->assertSame (['application/json ' ], $ headers ['content-type ' ]);
95
+ $ this ->assertTrue (0 < $ headers ['content-length ' ][0 ]);
98
96
99
97
$ this ->assertSame ('' , $ response ->getContent ());
100
98
}
@@ -265,6 +263,7 @@ public function test304()
265
263
$ client = $ this ->getHttpClient (__FUNCTION__ );
266
264
$ response = $ client ->request ('GET ' , 'http://localhost:8057/304 ' , [
267
265
'headers ' => ['If-Match ' => '"abc" ' ],
266
+ 'buffer ' => false ,
268
267
]);
269
268
270
269
$ this ->assertSame (304 , $ response ->getStatusCode ());
0 commit comments