public function KernelTestBaseDatabaseDriverModuleTest::testDatabaseDriverModuleEnabled in Drupal 9
Same name and namespace in other branches
- 10 core/tests/Drupal/KernelTests/KernelTestBaseDatabaseDriverModuleTest.php \Drupal\KernelTests\KernelTestBaseDatabaseDriverModuleTest::testDatabaseDriverModuleEnabled()
@covers ::bootEnvironment
File
- core/
tests/ Drupal/ KernelTests/ KernelTestBaseDatabaseDriverModuleTest.php, line 58
Class
- KernelTestBaseDatabaseDriverModuleTest
- @coversDefaultClass \Drupal\KernelTests\KernelTestBase
Namespace
Drupal\KernelTestsCode
public function testDatabaseDriverModuleEnabled() : void {
$driver = Database::getConnection()
->driver();
if (!in_array($driver, [
'DrivertestMysql',
'DrivertestPgsql',
])) {
$this
->markTestSkipped("This test does not support the {$driver} database driver.");
}
// Test that the module that is providing the database driver is enabled.
$this
->assertSame(1, \Drupal::service('extension.list.module')
->get('driver_test')->status);
}