Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / media / tests / modules / media_test_oembed / src / MediaTestOembedServiceProvider.php
diff --git a/web/core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php b/web/core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php
new file mode 100644 (file)
index 0000000..0ba3e0a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Drupal\media_test_oembed;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ServiceProviderBase;
+
+/**
+ * Replaces oEmbed-related media services with testing versions.
+ */
+class MediaTestOembedServiceProvider extends ServiceProviderBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function alter(ContainerBuilder $container) {
+    parent::alter($container);
+
+    $container->getDefinition('media.oembed.provider_repository')
+      ->setClass(ProviderRepository::class);
+
+    $container->getDefinition('media.oembed.url_resolver')
+      ->setClass(UrlResolver::class);
+  }
+
+}