3 use GuzzleHttp\Promise\PromiseInterface
;
4 use PHPUnit\Framework\Assert
;
5 use Psr\Http\Message\RequestInterface
;
6 use Psr\Http\Message\ResponseInterface
;
8 class NullGuzzleClient
extends \GuzzleHttp\Client
{
9 public function __construct( $config ) {
12 public function send( RequestInterface
$request, array $options = [] ): ResponseInterface
{
13 $url = $request->getUri();
14 Assert
::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
17 public function sendAsync( RequestInterface
$request, array $options = [] ): PromiseInterface
{
18 $url = $request->getUri();
19 Assert
::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
22 public function sendRequest( RequestInterface
$request ): ResponseInterface
{
23 $url = $request->getUri();
24 Assert
::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
27 public function request( string $method, $uri = '', array $options = [] ): ResponseInterface
{
28 Assert
::fail( "HTTP request blocked: $uri. Use MockHttpTrait." );
31 public function requestAsync( string $method, $uri = '', array $options = [] ): PromiseInterface
{
32 Assert
::fail( "HTTP request blocked: $uri. Use MockHttpTrait." );