function InstallerDeprecatedDriverNameTest::doInstall

Execute the non-interactive installer.

Overrides FunctionalTestSetupTrait::doInstall

See also

install_drupal()

File

core/tests/Drupal/FunctionalTests/Installer/InstallerDeprecatedDriverNameTest.php, line 28

Class

InstallerDeprecatedDriverNameTest
Tests deprecation of the non-interactive installer with driver name.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function doInstall() {
    require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
    $parameters = $this->installParameters();
    // Replace the driver namespace with the driver name in the
    // 'install_settings_form' parameter.
    $driverNamespace = $parameters['forms']['install_settings_form']['driver'];
    $driverName = Database::getDriverList()->get($driverNamespace)
        ->getDriverName();
    $parameters['forms']['install_settings_form']['driver'] = $driverName;
    $parameters['forms']['install_settings_form'][$driverName] = $parameters['forms']['install_settings_form'][$driverNamespace];
    unset($parameters['forms']['install_settings_form'][$driverNamespace]);
    // Simulate a real install which does not start with the any connections set
    // in \Drupal\Core\Database\Database::$connections.
    Database::removeConnection('default');
    $this->expectDeprecation("Passing a database driver name '{$driverName}' to install_get_form() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Pass a database driver namespace instead. See https://www.drupal.org/node/3258175");
    $this->expectDeprecation('Drupal\\Core\\Extension\\DatabaseDriverList::getFromDriverName() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use DatabaseDriverList::get() instead, passing a database driver namespace. See https://www.drupal.org/node/3258175');
    install_drupal($this->classLoader, $parameters);
}

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