function KernelTestBaseTest::testDatabaseDriverModuleEnabled

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/KernelTestBaseTest.php \Drupal\KernelTests\KernelTestBaseTest::testDatabaseDriverModuleEnabled()
  2. 11.x core/tests/Drupal/KernelTests/KernelTestBaseTest.php \Drupal\KernelTests\KernelTestBaseTest::testDatabaseDriverModuleEnabled()

@covers ::bootEnvironment

File

core/tests/Drupal/KernelTests/KernelTestBaseTest.php, line 448

Class

KernelTestBaseTest
@coversDefaultClass \Drupal\KernelTests\KernelTestBase

Namespace

Drupal\KernelTests

Code

public function testDatabaseDriverModuleEnabled() {
    $module = Database::getConnection()->getProvider();
    // Test that the module that is providing the database driver is enabled.
    $this->assertSame(1, \Drupal::service('extension.list.module')->get($module)->status);
}

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