public function ResourceFetcherTest::testFetchResource in Drupal 9
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/ResourceFetcherTest.php \Drupal\Tests\media\Functional\ResourceFetcherTest::testFetchResource()
Tests resource fetching.
@covers ::fetchResource
@dataProvider providerFetchResource
Parameters
string $resource_url: The URL of the resource to fetch, relative to the base URL.
string $provider_name: The expected name of the resource provider.
string $title: The expected title of the resource.
File
- core/
modules/ media/ tests/ src/ Functional/ ResourceFetcherTest.php, line 67
Class
- ResourceFetcherTest
- Tests the oEmbed resource fetcher service.
Namespace
Drupal\Tests\media\FunctionalCode
public function testFetchResource($resource_url, $provider_name, $title) {
/** @var \Drupal\media\OEmbed\Resource $resource */
$resource = $this->container
->get('media.oembed.resource_fetcher')
->fetchResource($resource_url);
$this
->assertInstanceOf(Resource::class, $resource);
$this
->assertSame($provider_name, $resource
->getProvider()
->getName());
$this
->assertSame($title, $resource
->getTitle());
}