Commit 83d4a01b authored by Bas de Nooijer's avatar Bas de Nooijer Committed by GitHub

Merge pull request #487 from thePanz/patch-1

Keep Response statusCode as integer, not string
parents eaf45495 16c6c88d
...@@ -157,7 +157,7 @@ class Response ...@@ -157,7 +157,7 @@ class Response
// $statusInfo[1] = the HTTP response code // $statusInfo[1] = the HTTP response code
// $statusInfo[2] = the response message // $statusInfo[2] = the response message
$statusInfo = explode(' ', $statusHeader, 3); $statusInfo = explode(' ', $statusHeader, 3);
$this->statusCode = $statusInfo[1]; $this->statusCode = (int) $statusInfo[1];
$this->statusMessage = $statusInfo[2]; $this->statusMessage = $statusInfo[2];
} }
} }
...@@ -89,7 +89,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase ...@@ -89,7 +89,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint); $response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -136,7 +136,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase ...@@ -136,7 +136,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint); $response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -185,7 +185,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase ...@@ -185,7 +185,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint); $response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -237,7 +237,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase ...@@ -237,7 +237,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint); $response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
......
...@@ -94,7 +94,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -94,7 +94,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint); $response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -141,7 +141,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -141,7 +141,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint); $response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -190,7 +190,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -190,7 +190,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint); $response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
...@@ -239,7 +239,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -239,7 +239,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint); $response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage()); $this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode()); $this->assertSame(200, $response->getStatusCode());
$this->assertSame( $this->assertSame(
array( array(
'HTTP/1.1 200 OK', 'HTTP/1.1 200 OK',
......
...@@ -211,7 +211,7 @@ EOF; ...@@ -211,7 +211,7 @@ EOF;
$response = $mock->execute($request, $endpoint); $response = $mock->execute($request, $endpoint);
$this->assertEquals($body, $response->getBody()); $this->assertEquals($body, $response->getBody());
$this->assertEquals($statusCode, $response->getStatusCode()); $this->assertSame($statusCode, $response->getStatusCode());
$this->assertEquals($statusMessage, $response->getStatusMessage()); $this->assertEquals($statusMessage, $response->getStatusMessage());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment