function ProviderRepositoryTest::testNonExistingProviderDatabase

Same name in other branches
  1. 9 core/modules/media/tests/src/Functional/ProviderRepositoryTest.php \Drupal\Tests\media\Functional\ProviderRepositoryTest::testNonExistingProviderDatabase()
  2. 10 core/modules/media/tests/src/Functional/ProviderRepositoryTest.php \Drupal\Tests\media\Functional\ProviderRepositoryTest::testNonExistingProviderDatabase()
  3. 11.x core/modules/media/tests/src/Functional/ProviderRepositoryTest.php \Drupal\Tests\media\Functional\ProviderRepositoryTest::testNonExistingProviderDatabase()
  4. 10 core/modules/media/tests/src/Kernel/ProviderRepositoryTest.php \Drupal\Tests\media\Kernel\ProviderRepositoryTest::testNonExistingProviderDatabase()
  5. 11.x core/modules/media/tests/src/Kernel/ProviderRepositoryTest.php \Drupal\Tests\media\Kernel\ProviderRepositoryTest::testNonExistingProviderDatabase()

Tests that provider discovery fails with a non-existent provider database.

@dataProvider providerNonExistingProviderDatabase

Parameters

string $providers_url: The URL of the provider database.

string $exception_message: The expected exception message.

File

core/modules/media/tests/src/Functional/ProviderRepositoryTest.php, line 66

Class

ProviderRepositoryTest
Tests the oEmbed provider repository.

Namespace

Drupal\Tests\media\Functional

Code

public function testNonExistingProviderDatabase($providers_url, $exception_message) {
    $this->config('media.settings')
        ->set('oembed_providers_url', $providers_url)
        ->save();
    $this->expectException(ProviderException::class);
    $this->expectExceptionMessage($exception_message);
    $this->container
        ->get('media.oembed.provider_repository')
        ->getAll();
}

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