Commit 16c6c88d authored by Ema Panz's avatar Ema Panz Committed by Emanuele Panzeri

Keep Response statusCode as integer, not string

parent aa463671
......@@ -157,7 +157,7 @@ class Response
// $statusInfo[1] = the HTTP response code
// $statusInfo[2] = the response message
$statusInfo = explode(' ', $statusHeader, 3);
$this->statusCode = $statusInfo[1];
$this->statusCode = (int) $statusInfo[1];
$this->statusMessage = $statusInfo[2];
}
}
......@@ -89,7 +89,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -136,7 +136,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -185,7 +185,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -237,7 +237,7 @@ final class Guzzle3Test extends \PHPUnit_Framework_TestCase
$response = $this->adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......
......@@ -94,7 +94,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -141,7 +141,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -190,7 +190,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......@@ -239,7 +239,7 @@ final class GuzzleAdapterTest extends \PHPUnit_Framework_TestCase
$response = $adapter->execute($request, $endpoint);
$this->assertSame('OK', $response->getStatusMessage());
$this->assertSame('200', $response->getStatusCode());
$this->assertSame(200, $response->getStatusCode());
$this->assertSame(
array(
'HTTP/1.1 200 OK',
......
......@@ -211,7 +211,7 @@ EOF;
$response = $mock->execute($request, $endpoint);
$this->assertEquals($body, $response->getBody());
$this->assertEquals($statusCode, $response->getStatusCode());
$this->assertSame($statusCode, $response->getStatusCode());
$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