Debian Codegraph @

tests/phpunit/mocks/NullGuzzleClient.php

raw symbols SCIP
1 <?php
2
3 use GuzzleHttp\Promise\PromiseInterface;
4 use PHPUnit\Framework\Assert;
5 use Psr\Http\Message\RequestInterface;
6 use Psr\Http\Message\ResponseInterface;
7
8 class NullGuzzleClient extends \GuzzleHttp\Client {
9 public function __construct( $config ) {
10 }
11
12 public function send( RequestInterface $request, array $options = [] ): ResponseInterface {
13 $url = $request->getUri();
14 Assert::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
15 }
16
17 public function sendAsync( RequestInterface $request, array $options = [] ): PromiseInterface {
18 $url = $request->getUri();
19 Assert::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
20 }
21
22 public function sendRequest( RequestInterface $request ): ResponseInterface {
23 $url = $request->getUri();
24 Assert::fail( "HTTP request blocked: $url. Use MockHttpTrait." );
25 }
26
27 public function request( string $method, $uri = '', array $options = [] ): ResponseInterface {
28 Assert::fail( "HTTP request blocked: $uri. Use MockHttpTrait." );
29 }
30
31 public function requestAsync( string $method, $uri = '', array $options = [] ): PromiseInterface {
32 Assert::fail( "HTTP request blocked: $uri. Use MockHttpTrait." );
33 }
34 }