/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->container->get('module_handler')->loadInclude('user', 'install'); $this->installEntitySchema('user'); user_install(); }
/** * {@inheritdoc} */ 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' => '*****@*****.**', 'pass' => 'original_password']); $user_account->save(); $this->originalPasswords[2] = $user_account->getPassword(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->installEntitySchema('file'); $this->installSchema('file', ['file_usage']); $this->installEntitySchema('node'); $this->installSchema('user', ['users_data']); // Make sure uid 1 is created. user_install(); $file = File::create(array('fid' => 2, 'uid' => 2, 'filename' => 'image-test.jpg', 'uri' => "public://image-test.jpg", 'filemime' => 'image/jpeg', 'created' => 1, 'changed' => 1, 'status' => FILE_STATUS_PERMANENT)); $file->enforceIsNew(); file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-1.png')); $file->save(); $file = File::create(array('fid' => 8, 'uid' => 8, 'filename' => 'image-test.png', 'uri' => "public://image-test.png", 'filemime' => 'image/png', 'created' => 1, 'changed' => 1, 'status' => FILE_STATUS_PERMANENT)); $file->enforceIsNew(); file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-2.jpg')); $file->save(); $this->migrateUsers(); }