MediaTestOembedServiceProvider.php

Same filename and directory in other branches
  1. 9 core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php
  2. 8.9.x core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php
  3. 10 core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php

Namespace

Drupal\media_test_oembed

File

core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php

View source
<?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);
    }

}

Classes

Title Deprecated Summary
MediaTestOembedServiceProvider Replaces oEmbed-related media services with testing versions.

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