function UrlConversionTest::testModuleDriverDoesNotExist

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testModuleDriverDoesNotExist()
  2. 8.9.x core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php \Drupal\Tests\Core\Database\UrlConversionTest::testModuleDriverDoesNotExist()
  3. 11.x 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 506

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public function testModuleDriverDoesNotExist() : void {
    $url = 'driver_test_mysql://test_user:test_pass@test_host:3306/test_database?module=driver_test';
    $this->expectException(UnknownExtensionException::class);
    $this->expectExceptionMessage("The database_driver Drupal\\driver_test\\Driver\\Database\\driver_test_mysql does not exist.");
    Database::convertDbUrlToConnectionInfo($url, $this->root, TRUE);
}

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