3 namespace Drupal\system\Tests\Installer;
5 use Drupal\Core\Database\Database;
6 use Drupal\simpletest\InstallerTestBase;
9 * Tests the installer with database errors.
13 class InstallerDatabaseErrorMessagesTest extends InstallerTestBase {
18 protected function setUpSettings() {
19 // We are creating a table here to force an error in the installer because
20 // it will try and create the drupal_install_test table as this is part of
21 // the standard database tests performed by the installer in
22 // Drupal\Core\Database\Install\Tasks.
23 Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NULL)');
24 parent::setUpSettings();
30 protected function setUpSite() {
31 // This step should not appear as we had a failure on the settings screen.
35 * Verifies that the error message in the settings step is correct.
37 public function testSetUpSettingsErrorMessage() {
38 $this->assertRaw('<ul><li>Failed to <strong>CREATE</strong> a test table');