function UrlResolver::setEndpointUrl

Same name in other branches
  1. 9 core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::setEndpointUrl()
  2. 10 core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::setEndpointUrl()
  3. 11.x core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php \Drupal\media_test_oembed\UrlResolver::setEndpointUrl()

Sets the endpoint URL for an oEmbed resource URL.

Parameters

string $url: The resource URL.

string $endpoint_url: The endpoint URL.

1 call to UrlResolver::setEndpointUrl()
OEmbedFormatterTest::testRender in core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
Tests the oEmbed field formatter.

File

core/modules/media/tests/modules/media_test_oembed/src/UrlResolver.php, line 20

Class

UrlResolver
Overrides the oEmbed URL resolver service for testing purposes.

Namespace

Drupal\media_test_oembed

Code

public static function setEndpointUrl($url, $endpoint_url) {
    $urls = \Drupal::state()->get(static::class, []);
    $urls[$url] = $endpoint_url;
    \Drupal::state()->set(static::class, $urls);
}

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