File tree 2 files changed +5
-4
lines changed 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,9 @@ public function sendRequest(RequestInterface $request)
120
120
121
121
if ($ request ->getMethod () == 'POST ' ) {
122
122
curl_setopt ($ this ->handle , CURLOPT_POST , true );
123
- if (!empty ($ request ->getBody ())) {
124
- curl_setopt ($ this ->handle , CURLOPT_POSTFIELDS , $ request ->getBody ());
123
+ $ body = $ request ->getBody ();
124
+ if (!empty ($ body )) {
125
+ curl_setopt ($ this ->handle , CURLOPT_POSTFIELDS , $ body );
125
126
}
126
127
}
127
128
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function testBasicGet()
34
34
{
35
35
$ client = new Client ();
36
36
$ response = $ client ->get ('http://www.google.com/ ' );
37
- $ this ->assertEquals (302 , $ response ->getStatusCode ());
37
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
38
38
$ this ->assertContains ('private ' , $ response ->getHeader ('Cache-Control ' ));
39
39
$ this ->assertEquals ('1.1 ' , $ response ->getProtocolVersion ());
40
40
$ this ->assertNotEmpty ($ response ->getBody ());
@@ -44,7 +44,7 @@ public function testBasicHead()
44
44
{
45
45
$ client = new Client ();
46
46
$ response = $ client ->head ('http://www.google.com/ ' );
47
- $ this ->assertEquals (302 , $ response ->getStatusCode ());
47
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
48
48
$ this ->assertContains ('private ' , $ response ->getHeader ('Cache-Control ' ));
49
49
$ this ->assertEquals ('1.1 ' , $ response ->getProtocolVersion ());
50
50
$ this ->assertEmpty ($ response ->getBody ());
You can’t perform that action at this time.
0 commit comments