function UrlResolverTest::testUrlDiscovery

Same name in other branches
  1. 9 core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testUrlDiscovery()
  2. 10 core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testUrlDiscovery()
  3. 11.x core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testUrlDiscovery()

Tests URL resolution when the resource URL must be actively discovered by scanning the asset.

@covers ::discoverResourceUrl @covers ::getProviderByUrl @covers ::getResourceUrl

@dataProvider providerUrlDiscovery

Parameters

string $url: The asset URL to resolve.

string $resource_url: The expected oEmbed resource URL of the asset.

File

core/modules/media/tests/src/Functional/UrlResolverTest.php, line 131

Class

UrlResolverTest
Tests the oEmbed URL resolver service.

Namespace

Drupal\Tests\media\Functional

Code

public function testUrlDiscovery($url, $resource_url) {
    $this->assertSame($this->container
        ->get('media.oembed.url_resolver')
        ->getResourceUrl($url), $resource_url);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.