-
Notifications
You must be signed in to change notification settings - Fork 9
3.x preparation : Make httplug optional, depends on psr18 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,10 +59,7 @@ public static function tearDownAfterClass() | |
} | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function requestProvider() | ||
public function requestProvider(): array | ||
{ | ||
$sets = [ | ||
'methods' => $this->getMethods(), | ||
|
@@ -85,10 +82,7 @@ public function requestProvider() | |
}); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function requestWithOutcomeProvider() | ||
public function requestWithOutcomeProvider(): array | ||
{ | ||
$sets = [ | ||
'urisAndOutcomes' => $this->getUrisAndOutcomes(), | ||
|
@@ -102,10 +96,7 @@ public function requestWithOutcomeProvider() | |
return $cartesianProduct->compute(); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
private function getMethods() | ||
private function getMethods(): array | ||
{ | ||
return [ | ||
'GET', | ||
|
@@ -211,14 +202,8 @@ private function getData() | |
return ['param1' => 'foo', 'param2' => ['bar', ['baz']]]; | ||
} | ||
|
||
/** | ||
* @param ResponseInterface $response | ||
* @param array $options | ||
*/ | ||
protected function assertResponse($response, array $options = []) | ||
protected function assertResponse(ResponseInterface $response, array $options = []) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the explicit assertion would lead to a phpunit failure instead of a full php type explosion. but the client interface has a return type declaration, so it should be impossible to ever have anything else than a ResponseInterface, right? if thats the case then the change is fine for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, php will fail before that so we are pretty safe here |
||
{ | ||
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response); | ||
|
||
$options = array_merge($this->defaultOptions, $options); | ||
|
||
// The response version may be greater or equal to the request version. See https://tools.ietf.org/html/rfc2145#section-2.3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
|
||
namespace Http\Client\Tests; | ||
|
||
use Http\Client\HttpClient; | ||
use Psr\Http\Client\ClientInterface; | ||
|
||
/** | ||
* @author GeLo <[email protected]> | ||
*/ | ||
abstract class HttpClientTest extends HttpBaseTest | ||
{ | ||
/** | ||
* @var HttpClient | ||
* @var ClientInterface | ||
*/ | ||
protected $httpAdapter; | ||
|
||
|
@@ -30,10 +30,7 @@ protected function tearDown() | |
unset($this->httpAdapter); | ||
} | ||
|
||
/** | ||
* @return HttpClient | ||
*/ | ||
abstract protected function createHttpAdapter(); | ||
abstract protected function createHttpAdapter(): ClientInterface; | ||
|
||
/** | ||
* @dataProvider requestProvider | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the branch alias in the composer.json file needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 totally forget this comment my bad, should be good