3 namespace Drupal\Tests\video_embed_field\Kernel;
5 use GuzzleHttp\ClientInterface;
6 use Psr\Http\Message\RequestInterface;
9 * An exceptional HTTP client mock.
11 class MockHttpClient implements ClientInterface {
14 * An exception message for the client methods.
16 const EXCEPTION_MESSAGE = "The HTTP mock can't do anything.";
21 public function send(RequestInterface $request, array $options = []) {
22 throw new \Exception(static::EXCEPTION_MESSAGE);
28 public function sendAsync(RequestInterface $request, array $options = []) {
29 throw new \Exception(static::EXCEPTION_MESSAGE);
35 public function request($method, $uri, array $options = []) {
36 throw new \Exception(static::EXCEPTION_MESSAGE);
42 public function requestAsync($method, $uri, array $options = []) {
43 throw new \Exception(static::EXCEPTION_MESSAGE);
49 public function getConfig($option = NULL) {
50 throw new \Exception(static::EXCEPTION_MESSAGE);
54 * Patch up a magic method call.
56 public function head($url) {
57 throw new \Exception(static::EXCEPTION_MESSAGE);