You are here

protected function FunctionalTestSetupTrait::installParameters in Drupal 8

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

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

Return value

array Array of parameters for use in install_drupal().

See also

install_drupal()

install_state_defaults()

14 calls to FunctionalTestSetupTrait::installParameters()
DemoUmamiProfileTest::installParameters in core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
FunctionalTestSetupTrait::doInstall in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Execute the non-interactive installer.
HelpTopicTranslatedTestBase::installParameters in core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerExistingConfigTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerSiteConfigProfileTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.

... See full list

9 methods override FunctionalTestSetupTrait::installParameters()
DemoUmamiProfileTest::installParameters in core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
HelpTopicTranslatedTestBase::installParameters in core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerExistingConfigTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerSiteConfigProfileTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerTranslationMultipleLanguageTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
Returns the parameters that will be used when Simpletest installs Drupal.

... See full list

File

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

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'];
  $connection_info['default']['prefix'] = $connection_info['default']['prefix']['default'];
  unset($connection_info['default']['driver']);
  unset($connection_info['default']['namespace']);
  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' => isset($this->rootUser->pass_raw) ? $this->rootUser->pass_raw : $this->rootUser->passRaw,
            'pass2' => isset($this->rootUser->pass_raw) ? $this->rootUser->pass_raw : $this->rootUser->passRaw,
          ],
        ],
        // form_type_checkboxes_value() 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;
}