InstallerExistingConfigExistingSettingsTest.php

Same filename and directory in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigExistingSettingsTest.php
  2. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigExistingSettingsTest.php

Namespace

Drupal\FunctionalTests\Installer

File

core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigExistingSettingsTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\FunctionalTests\Installer;

use Drupal\Core\Database\Database;

/**
 * Verifies that installing from existing configuration works.
 *
 * @group Installer
 */
class InstallerExistingConfigExistingSettingsTest extends InstallerExistingConfigTest {
  
  /**
   * {@inheritdoc}
   *
   * Partially configures a preexisting settings.php file before invoking the
   * interactive installer.
   */
  protected function prepareEnvironment() {
    parent::prepareEnvironment();
    // Pre-configure hash salt.
    // Any string is valid, so simply use the class name of this test.
    $this->settings['settings']['hash_salt'] = (object) [
      'value' => __CLASS__,
      'required' => TRUE,
    ];
    // Pre-configure database credentials.
    $connection_info = Database::getConnectionInfo();
    unset($connection_info['default']['pdo']);
    unset($connection_info['default']['init_commands']);
    $this->settings['databases']['default'] = (object) [
      'value' => $connection_info,
      'required' => TRUE,
    ];
  }

}

Classes

Title Deprecated Summary
InstallerExistingConfigExistingSettingsTest Verifies that installing from existing configuration works.

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