function DatabaseTest::testFindDriverAutoloadDirectoryException

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 <a href="/api/drupal/core%21lib%21Drupal%21Core%21Database%21Database.php/class/Database/8.9.x" title="Primary front-controller for the database system." class="local">\Drupal\Core\Database\Database</a>

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);
}

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