You are here

protected function FunctionalTestSetupTrait::installParameters in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters()
  2. 9 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters()

Returns the parameters that will be used when the test installs Drupal.

Return value

array Array of parameters for use in install_drupal().

See also

install_drupal()

install_state_defaults()

6 calls to FunctionalTestSetupTrait::installParameters()
FunctionalTestSetupTrait::doInstall in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Execute the non-interactive installer.
InstallerTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
Returns the parameters that will be used when the test installs Drupal.
InstallerTranslationMultipleLanguageNonInteractiveTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
Returns the parameters that will be used when the test installs Drupal.
SiteNameTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php
Returns the parameters that will be used when the test installs Drupal.
TestingProfileInstallTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php
Returns the parameters that will be used when the test installs Drupal.

... See full list

4 methods override FunctionalTestSetupTrait::installParameters()
InstallerTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
Returns the parameters that will be used when the test installs Drupal.
InstallerTranslationMultipleLanguageNonInteractiveTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
Returns the parameters that will be used when the test installs Drupal.
SiteNameTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php
Returns the parameters that will be used when the test installs Drupal.
TestingProfileInstallTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php
Returns the parameters that will be used when the test installs Drupal.

File

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

Class

FunctionalTestSetupTrait
Defines a trait for shared functional test setup functionality.

Namespace

Drupal\Core\Test

Code

protected function installParameters() {
  $connection_info = Database::getConnectionInfo();
  $driver = $connection_info['default']['driver'];
  unset($connection_info['default']['driver']);
  unset($connection_info['default']['namespace']);
  unset($connection_info['default']['autoload']);
  unset($connection_info['default']['pdo']);
  unset($connection_info['default']['init_commands']);

  // Remove database connection info that is not used by SQLite.
  if ($driver === 'sqlite') {
    unset($connection_info['default']['username']);
    unset($connection_info['default']['password']);
    unset($connection_info['default']['host']);
    unset($connection_info['default']['port']);
  }
  $parameters = [
    'interactive' => FALSE,
    'parameters' => [
      'profile' => $this->profile,
      'langcode' => 'en',
    ],
    'forms' => [
      'install_settings_form' => [
        'driver' => $driver,
        $driver => $connection_info['default'],
      ],
      'install_configure_form' => [
        'site_name' => 'Drupal',
        'site_mail' => 'simpletest@example.com',
        'account' => [
          'name' => $this->rootUser->name,
          'mail' => $this->rootUser
            ->getEmail(),
          'pass' => [
            'pass1' => $this->rootUser->pass_raw ?? $this->rootUser->passRaw,
            'pass2' => $this->rootUser->pass_raw ?? $this->rootUser->passRaw,
          ],
        ],
        // \Drupal\Core\Render\Element\Checkboxes::valueCallback() requires
        // NULL instead of FALSE values for programmatic form submissions to
        // disable a checkbox.
        'enable_update_status_module' => NULL,
        'enable_update_status_emails' => NULL,
      ],
    ],
  ];

  // If we only have one db driver available, we cannot set the driver.
  include_once DRUPAL_ROOT . '/core/includes/install.inc';
  if (count($this
    ->getDatabaseTypes()) == 1) {
    unset($parameters['forms']['install_settings_form']['driver']);
  }
  return $parameters;
}