function UrlResolverTest::testResourceUrlAlterHook
Same name in other branches
- 8.9.x core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testResourceUrlAlterHook()
- 10 core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testResourceUrlAlterHook()
- 11.x core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::testResourceUrlAlterHook()
Tests that hook_oembed_resource_url_alter() is invoked.
@depends testEndpointMatching
File
-
core/
modules/ media/ tests/ src/ Functional/ UrlResolverTest.php, line 85
Class
- UrlResolverTest
- Tests the oEmbed URL resolver service.
Namespace
Drupal\Tests\media\FunctionalCode
public function testResourceUrlAlterHook() {
$this->container
->get('module_installer')
->install([
'media_test_oembed',
]);
$resource_url = $this->container
->get('media.oembed.url_resolver')
->getResourceUrl('https://vimeo.com/14782834');
$this->assertStringContainsString('altered=1', parse_url($resource_url, PHP_URL_QUERY));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.