You are here

public function MediaMigrationTestOembedServiceProvider::alter in Media Migration 8

Modifies existing service definitions.

Parameters

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

Overrides ServiceProviderBase::alter

File

tests/modules/media_migration_test_oembed/src/MediaMigrationTestOembedServiceProvider.php, line 16

Class

MediaMigrationTestOembedServiceProvider
Replaces oEmbed-related media services which would make outbound requests.

Namespace

Drupal\media_migration_test_oembed

Code

public function alter(ContainerBuilder $container) {
  $container
    ->getDefinition('media.oembed.url_resolver')
    ->setClass(UrlResolver::class);
  $container
    ->getDefinition('media.oembed.resource_fetcher')
    ->setClass(ResourceFetcher::class);
}