Skip to content

Commit 4ab0339

Browse files
committed
* Small fixes
1 parent 9f5734b commit 4ab0339

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Client.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ public function sendRequest(RequestInterface $request)
120120

121121
if ($request->getMethod() == 'POST') {
122122
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);
125126
}
126127
}
127128

tests/ClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testBasicGet()
3434
{
3535
$client = new Client();
3636
$response = $client->get('http://www.google.com/');
37-
$this->assertEquals(302, $response->getStatusCode());
37+
$this->assertEquals(200, $response->getStatusCode());
3838
$this->assertContains('private', $response->getHeader('Cache-Control'));
3939
$this->assertEquals('1.1', $response->getProtocolVersion());
4040
$this->assertNotEmpty($response->getBody());
@@ -44,7 +44,7 @@ public function testBasicHead()
4444
{
4545
$client = new Client();
4646
$response = $client->head('http://www.google.com/');
47-
$this->assertEquals(302, $response->getStatusCode());
47+
$this->assertEquals(200, $response->getStatusCode());
4848
$this->assertContains('private', $response->getHeader('Cache-Control'));
4949
$this->assertEquals('1.1', $response->getProtocolVersion());
5050
$this->assertEmpty($response->getBody());

0 commit comments

Comments
 (0)