Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure we support any psr-18 client (#295)
* Make sure we support any psr-18 client * wring use statement * Updated exceptions * use use statements * Added tests with a PSR18 client
- Loading branch information
Showing
9 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Http\HttplugBundle\Tests\Resources; | ||
|
||
use GuzzleHttp\Psr7\Response; | ||
use Psr\Http\Client\ClientInterface; | ||
use Psr\Http\Message\RequestInterface; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class MyPsr18TestClient implements ClientInterface | ||
{ | ||
public function sendRequest(RequestInterface $request): ResponseInterface | ||
{ | ||
return new Response(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
imports: | ||
- { resource: config_test.yml } | ||
|
||
httplug: | ||
discovery: | ||
async_client: auto | ||
clients: | ||
my_psr18: | ||
service: 'my_psr18_client' | ||
public: true | ||
plugins: | ||
- | ||
decoder: | ||
use_content_encoding: false | ||
- app.http.plugin.custom | ||
- | ||
add_host: | ||
host: "http://localhost:8000" | ||
- | ||
authentication: | ||
my_basic: | ||
type: basic | ||
username: foo | ||
password: bar | ||
|
||
services: | ||
my_psr18_client: | ||
class: Http\HttplugBundle\Tests\Resources\MyPsr18TestClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters