Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
83d4a01b
Commit
83d4a01b
authored
Mar 05, 2017
by
Bas de Nooijer
Committed by
GitHub
Mar 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #487 from thePanz/patch-1
Keep Response statusCode as integer, not string
parents
eaf45495
16c6c88d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
library/Solarium/Core/Client/Response.php
library/Solarium/Core/Client/Response.php
+1
-1
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
+4
-4
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
+4
-4
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
+1
-1
No files found.
library/Solarium/Core/Client/Response.php
View file @
83d4a01b
...
@@ -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
];
}
}
}
}
tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php
View file @
83d4a01b
...
@@ -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'
,
...
...
tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php
View file @
83d4a01b
...
@@ -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'
,
...
...
tests/Solarium/Tests/Core/Client/Adapter/PeclHttpTest.php
View file @
83d4a01b
...
@@ -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
->
assert
Equals
(
$statusCode
,
$response
->
getStatusCode
());
$this
->
assert
Same
(
$statusCode
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
$statusMessage
,
$response
->
getStatusMessage
());
$this
->
assertEquals
(
$statusMessage
,
$response
->
getStatusMessage
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment