Commit be189a88 authored by catch's avatar catch

Issue #2554151 by stefan.r, Gábor Hojtsy, plach, dawehner, csg: Test...

Issue #2554151 by stefan.r, Gábor Hojtsy, plach, dawehner, csg: Test content/configuration in update database dump
parent 82db4839
......@@ -186,14 +186,7 @@ protected function setUp() {
// not safe to do here, because the database has not been updated yet.
$this->container = \Drupal::getContainer();
// Replace User 1 with the user created here.
// @todo: do this without saving the user account.
/** @var \Drupal\user\UserInterface $account */
$account = User::load(1);
$account->setPassword($this->rootUser->pass_raw);
$account->setEmail($this->rootUser->getEmail());
$account->setUsername($this->rootUser->getUsername());
$account->save();
$this->replaceUser1();
}
/**
......@@ -266,4 +259,18 @@ protected function runUpdates() {
$this->assertFalse(\Drupal::service('entity.definition_update_manager')->needsUpdates(), 'After all updates ran, entity schema is up to date.');
}
/**
* Replace User 1 with the user created here.
*/
protected function replaceUser1() {
/** @var \Drupal\user\UserInterface $account */
// @todo: Saving the account before the update is problematic.
// https://www.drupal.org/node/2560237
$account = User::load(1);
$account->setPassword($this->rootUser->pass_raw);
$account->setEmail($this->rootUser->getEmail());
$account->setUsername($this->rootUser->getUsername());
$account->save();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment