You are here

public static function ResourceController::setResourceUrl in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php \Drupal\media_test_oembed\Controller\ResourceController::setResourceUrl()
  2. 10 core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php \Drupal\media_test_oembed\Controller\ResourceController::setResourceUrl()

Maps an asset URL to a local fixture representing its oEmbed resource.

Parameters

string $asset_url: The asset URL.

string $resource_path: The path of the oEmbed resource representing the asset.

5 calls to ResourceController::setResourceUrl()
MediaSourceOEmbedVideoTest::testMediaOEmbedVideoSource in core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
Tests the oembed media source.
MediaStandardProfileTest::remoteVideoTest in core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php
Tests the standard profile configuration for media type 'remote_video'.
OEmbedFormatterTest::testRender in core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
Tests the oEmbed field formatter.
WidgetOEmbedTest::testWidgetOEmbed in core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
Tests that oEmbed media can be added in the Media library's widget.
WidgetOEmbedTest::testWidgetOEmbedAdvancedUi in core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
Tests that oEmbed media can be added in the widget's advanced UI.

File

core/modules/media/tests/modules/media_test_oembed/src/Controller/ResourceController.php, line 60

Class

ResourceController
Test controller returning oEmbed resources from Media's test fixtures.

Namespace

Drupal\media_test_oembed\Controller

Code

public static function setResourceUrl($asset_url, $resource_path) {
  $resources = \Drupal::state()
    ->get(static::class, []);
  $resources[$asset_url] = $resource_path;
  \Drupal::state()
    ->set(static::class, $resources);
}