You are here

public function ProviderRepositoryTest::testProvidersAlterHook in oEmbed Providers 2.x

Same name and namespace in other branches
  1. 1.1.x tests/src/Functional/ProviderRepositoryTest.php \Drupal\Tests\oembed_providers\Functional\ProviderRepositoryTest::testProvidersAlterHook()

Tests that hook_oembed_providers_alter() is invoked.

File

tests/src/Functional/ProviderRepositoryTest.php, line 127

Class

ProviderRepositoryTest
Tests the oEmbed provider repository.

Namespace

Drupal\Tests\oembed_providers\Functional

Code

public function testProvidersAlterHook() {
  $this->container
    ->get('module_installer')
    ->install([
    'oembed_providers_test',
  ]);
  $providers = $this->container
    ->get('media.oembed.provider_repository')
    ->getAll();
  $this
    ->assertArrayHasKey('My Custom Provider', $providers);
}