You are here

public function MediaTestOembedServiceProvider::alter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php \Drupal\media_test_oembed\MediaTestOembedServiceProvider::alter()

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php, line 16

Class

MediaTestOembedServiceProvider
Replaces oEmbed-related media services with testing versions.

Namespace

Drupal\media_test_oembed

Code

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);
}