protected function UpdateRemovedPostUpdateTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateRemovedPostUpdateTest::setUp()
Overrides BrowserTestBase::setUp
File
- core/
modules/ system/ tests/ src/ Functional/ UpdateSystem/ UpdateRemovedPostUpdateTest.php, line 26
Class
Namespace
Drupal\Tests\system\Functional\UpdateSystemCode
protected function setUp() : void {
parent::setUp();
$connection = Database::getConnection();
// Set the schema version.
\Drupal::service('update.update_hook_registry')
->setInstalledVersion('update_test_postupdate', 8000);
// Update core.extension.
$extensions = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['update_test_postupdate'] = 8000;
$connection
->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
$this->updateUrl = Url::fromRoute('system.db_update');
$this->updateUser = $this
->drupalCreateUser([
'administer software updates',
]);
}