class MediaTestOembedServiceProvider

Same name in other branches
  1. 9 core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php \Drupal\media_test_oembed\MediaTestOembedServiceProvider
  2. 8.9.x core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php \Drupal\media_test_oembed\MediaTestOembedServiceProvider
  3. 11.x core/modules/media/tests/modules/media_test_oembed/src/MediaTestOembedServiceProvider.php \Drupal\media_test_oembed\MediaTestOembedServiceProvider

Replaces oEmbed-related media services with testing versions.

Hierarchy

Expanded class hierarchy of MediaTestOembedServiceProvider

File

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

Namespace

Drupal\media_test_oembed
View source
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);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
MediaTestOembedServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1

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