You are here

protected function InstallerDatabaseErrorMessagesTest::setUpSettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php \Drupal\FunctionalTests\Installer\InstallerDatabaseErrorMessagesTest::setUpSettings()

Installer step: Configure settings.

Overrides InstallerTestBase::setUpSettings

File

core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php, line 22

Class

InstallerDatabaseErrorMessagesTest
Tests the installer with database errors.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function setUpSettings() {

  // We are creating a table here to force an error in the installer because
  // it will try and create the drupal_install_test table as this is part of
  // the standard database tests performed by the installer in
  // Drupal\Core\Database\Install\Tasks.
  $spec = [
    'fields' => [
      'id' => [
        'type' => 'int',
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  Database::getConnection('default')
    ->schema()
    ->createTable('drupal_install_test', $spec);
  parent::setUpSettings();
}