function FunctionalTestSetupTrait::getDatabaseTypes

Same name in other branches
  1. 9 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::getDatabaseTypes()
  2. 8.9.x core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::getDatabaseTypes()
  3. 10 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::getDatabaseTypes()

Returns all supported database driver installer objects.

This wraps DatabaseDriverList::getInstallableList() for use without a current container.

Return value

\Drupal\Core\Database\Install\Tasks[] An array of available database driver installer objects.

1 call to FunctionalTestSetupTrait::getDatabaseTypes()
FunctionalTestSetupTrait::installParameters in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Returns the parameters that will be used when the test installs Drupal.

File

core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php, line 731

Class

FunctionalTestSetupTrait
Defines a trait for shared functional test setup functionality.

Namespace

Drupal\Core\Test

Code

protected function getDatabaseTypes() {
    if (isset($this->originalContainer) && $this->originalContainer) {
        \Drupal::setContainer($this->originalContainer);
    }
    $database_types = [];
    foreach (Database::getDriverList()->getInstallableList() as $name => $driver) {
        $database_types[$name] = $driver->getInstallTasks();
    }
    if (isset($this->originalContainer) && $this->originalContainer) {
        \Drupal::unsetContainer();
    }
    return $database_types;
}

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