Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / mocks / NullGuzzleClient.php
blobb39164066938ba41cef2e23c89d82a9032e052d0
1 <?php
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." );