function ResourceFetcherTest::testFetchResource
Same name in other branches
- 9 core/modules/media/tests/src/Functional/ResourceFetcherTest.php \Drupal\Tests\media\Functional\ResourceFetcherTest::testFetchResource()
- 8.9.x core/modules/media/tests/src/Functional/ResourceFetcherTest.php \Drupal\Tests\media\Functional\ResourceFetcherTest::testFetchResource()
- 10 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 71
Class
- ResourceFetcherTest
- Tests the oEmbed resource fetcher service.
Namespace
Drupal\Tests\media\FunctionalCode
public function testFetchResource($resource_url, $provider_name, $title) : void {
/** @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());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.