3 use PHPUnit\Framework\Assert
;
4 use PHPUnit\Framework\AssertionFailedError
;
5 use Wikimedia\Http\MultiHttpClient
;
8 * A simple {@link MultiHttpClient} implementation that can be used to prevent
9 * HTTP requests in tests. All attempts to execute a request will fail.
11 * Use MockHttpTrait for controlling responses to mock HTTP requests.
13 * @author Daniel Kinzler
14 * @license GPL-2.0-or-later
16 class NullMultiHttpClient
extends MultiHttpClient
{
24 * @throws AssertionFailedError always
26 public function runMulti( array $reqs, array $opts = [] ) {
27 $urls = implode( ', ', array_column( $reqs, 'url' ) );
28 Assert
::fail( "HTTP requests to {$urls} blocked. Use MockHttpTrait." );