function UpdatePathTestBase::doInstall
Same name and namespace in other branches
- 9 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::doInstall()
- 8.9.x core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::doInstall()
- 10 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::doInstall()
Execute the non-interactive installer.
Overrides FunctionalTestSetupTrait::doInstall
1 call to UpdatePathTestBase::doInstall()
- UpdatePathTestBase::installDrupal in core/
tests/ Drupal/ FunctionalTests/ Update/ UpdatePathTestBase.php - Overrides BrowserTestBase::installDrupal() for update testing.
File
-
core/
tests/ Drupal/ FunctionalTests/ Update/ UpdatePathTestBase.php, line 133
Class
- UpdatePathTestBase
- Provides a base class for writing an update test.
Namespace
Drupal\FunctionalTests\UpdateCode
protected function doInstall() {
$this->runDbTasks();
// Allow classes to set database dump files.
$this->setDatabaseDumpFiles();
// Load the database(s).
foreach ($this->databaseDumpFiles as $file) {
// Determine the version of the database dump if specified.
$matches = [];
$dumpVersion = preg_match('/drupal-(\\d+\\.\\d+\\.\\d+)\\./', $file, $matches) === 1 ? $matches[1] : NULL;
// If the db driver is mysqli, we do not need to run the update tests for
// db dumps prior to 11.2 when the module was introduced.
if (Database::getConnection()->getProvider() === 'mysqli' && $dumpVersion && version_compare($dumpVersion, '11.2.0', '<')) {
$this->markTestSkipped("The mysqli driver was introduced in Drupal 11.2, skip update tests from database at version {$dumpVersion}");
}
if (str_ends_with($file, '.gz')) {
$file = "compress.zlib://{$file}";
}
require $file;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.