function FunctionalTestSetupTrait::initSettings
Same name in other branches
- 9 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::initSettings()
- 10 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::initSettings()
- 11.x core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::initSettings()
Initialize settings created during install.
5 calls to FunctionalTestSetupTrait::initSettings()
- BrowserTestBase::installDrupal in core/
tests/ Drupal/ Tests/ BrowserTestBase.php - Installs Drupal into the Simpletest site.
- TestSiteInstallCommand::installDrupal in core/
tests/ Drupal/ TestSite/ Commands/ TestSiteInstallCommand.php - Installs Drupal into the test site.
- UpdatePathTestBase::installDrupal in core/
tests/ Drupal/ FunctionalTests/ Update/ UpdatePathTestBase.php - Installs Drupal into the Simpletest site.
- UpdatePathTestBase::setUp in core/
modules/ system/ src/ Tests/ Update/ UpdatePathTestBase.php - Overrides WebTestBase::setUp() for update testing.
- WebTestBase::setUp in core/
modules/ simpletest/ src/ WebTestBase.php - Sets up a Drupal site for running functional and integration tests.
File
-
core/
lib/ Drupal/ Core/ Test/ FunctionalTestSetupTrait.php, line 302
Class
- FunctionalTestSetupTrait
- Defines a trait for shared functional test setup functionality.
Namespace
Drupal\Core\TestCode
protected function initSettings() {
Settings::initialize(DRUPAL_ROOT, $this->siteDirectory, $this->classLoader);
$this->configDirectories['sync'] = Settings::get('config_sync_directory');
// After writing settings.php, the installer removes write permissions
// from the site directory. To allow drupal_generate_test_ua() to write
// a file containing the private key for drupal_valid_test_ua(), the site
// directory has to be writable.
// TestBase::restoreEnvironment() will delete the entire site directory.
// Not using File API; a potential error must trigger a PHP warning.
chmod(DRUPAL_ROOT . '/' . $this->siteDirectory, 0777);
// During tests, cacheable responses should get the debugging cacheability
// headers by default.
$this->setContainerParameter('http.response.debug_cacheability_headers', TRUE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.