You are here

public function UrlConversionTest::testModuleDriverDoesNotExist in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testModuleDriverDoesNotExist()
  2. 10 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testModuleDriverDoesNotExist()

@covers ::convertDbUrlToConnectionInfo

File

core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php, line 413

Class

UrlConversionTest
Tests for database URL to/from database connection array coversions.

Namespace

Drupal\Tests\Core\Database

Code

public function testModuleDriverDoesNotExist() {
  $url = 'mysql://test_user:test_pass@test_host:3306/test_database?module=driver_test';
  $this
    ->expectException(\RuntimeException::class);
  $this
    ->expectExceptionMessage("Cannot find the database driver namespace 'Drupal\\driver_test\\Driver\\Database\\mysql' in module 'driver_test'");
  Database::convertDbUrlToConnectionInfo($url, $this->root);
}