protected function MigrateUserAdminPassTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php \Drupal\Tests\user\Kernel\Migrate\MigrateUserAdminPassTest::setUp()
Overrides MigrateTestBase::setUp
File
- core/
modules/ user/ tests/ src/ Kernel/ Migrate/ MigrateUserAdminPassTest.php, line 32
Class
- MigrateUserAdminPassTest
- Tests preservation of root account password.
Namespace
Drupal\Tests\user\Kernel\MigrateCode
protected function setUp() {
parent::setUp();
// Make sure the admin user and a regular user are created.
$this->container
->get('module_handler')
->loadInclude('user', 'install');
$this
->installEntitySchema('user');
user_install();
/** @var \Drupal\user\Entity\User $admin_account */
$admin_account = User::load(1);
$admin_account
->setPassword('original');
$admin_account
->save();
$this->originalPasswords[1] = $admin_account
->getPassword();
/** @var \Drupal\user\Entity\User $user_account */
$user_account = User::create([
'uid' => 2,
'name' => 'original_username',
'mail' => 'original_email@example.com',
'pass' => 'original_password',
]);
$user_account
->save();
$this->originalPasswords[2] = $user_account
->getPassword();
}