function InstallerNonDefaultDatabaseDriverTest::testInstalled

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php \Drupal\FunctionalTests\Installer\InstallerNonDefaultDatabaseDriverTest::testInstalled()
  2. 10 core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php \Drupal\FunctionalTests\Installer\InstallerNonDefaultDatabaseDriverTest::testInstalled()
  3. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php \Drupal\FunctionalTests\Installer\InstallerNonDefaultDatabaseDriverTest::testInstalled()

Confirms that the installation succeeded.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php, line 53

Class

InstallerNonDefaultDatabaseDriverTest
Tests the interactive installer.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testInstalled() {
    $this->assertUrl('user/1');
    $this->assertSession()
        ->statusCodeEquals(200);
    // Assert that in the settings.php the database connection array has the
    // correct values set.
    $contents = file_get_contents($this->root . '/' . $this->siteDirectory . '/settings.php');
    $this->assertStringContainsString("'namespace' => 'Drupal\\\\driver_test\\\\Driver\\\\Database\\\\{$this->testDriverName}',", $contents);
    $this->assertStringContainsString("'driver' => '{$this->testDriverName}',", $contents);
    $this->assertStringContainsString("'autoload' => 'core/modules/system/tests/modules/driver_test/src/Driver/Database/{$this->testDriverName}/',", $contents);
}

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