You are here

public function DatabaseTest::testFindDriverAutoloadDirectoryException in Drupal 8

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

@covers ::findDriverAutoloadDirectory @dataProvider providerFindDriverAutoloadDirectoryException

File

core/tests/Drupal/Tests/Core/Database/DatabaseTest.php, line 83

Class

DatabaseTest
@coversDefaultClass \Drupal\Core\Database\Database

Namespace

Drupal\Tests\Core\Database

Code

public function testFindDriverAutoloadDirectoryException($expected_message, $namespace, $include_tests) {
  new Settings([
    'extension_discovery_scan_tests' => $include_tests,
  ]);
  if ($include_tests === FALSE) {

    // \Drupal\Core\Extension\ExtensionDiscovery::scan() needs
    // drupal_valid_test_ua().
    include $this->root . '/core/includes/bootstrap.inc';
  }
  $this
    ->expectException(\RuntimeException::class);
  $this
    ->expectExceptionMessage($expected_message);
  Database::findDriverAutoloadDirectory($namespace, $this->root);
}