ResourceFetcher example

'version' => '1.0',
      'type' => 'video',
      'html' => 'test',
    ]);
    $response = new Response(200, $headers$body);

    $client = $this->prophesize(Client::class);
    $client->request('GET', $url[RequestOptions::TIMEOUT => 5])
      ->shouldBeCalled()
      ->willReturn($response);

    $fetcher = new ResourceFetcher(
      $client->reveal(),
      $this->createMock('\Drupal\media\OEmbed\ProviderRepositoryInterface'),
      new NullBackend('default')
    );
    $fetcher->fetchResource($url);
  }

  /** * Tests how the resource fetcher handles unknown Content-Type headers. * * @covers ::fetchResource */
Home | Imprint | This part of the site doesn't use cookies.