diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php index fdbbc99..814e138 100644 --- a/core/modules/user/src/Tests/UserLoginTest.php +++ b/core/modules/user/src/Tests/UserLoginTest.php @@ -48,7 +48,7 @@ function testLoginCacheTagsAndDestination() { $this->assertUrl('foo', [], 'Redirected to the correct URL'); $this->passwordHasher = $this->container->get('password'); - $this->drupal7PasswordHasher = $this->container->get('drupal7_password'); + $this->drupal7PasswordHasher = $this->container->get('password.drupal7'); } /** @@ -179,18 +179,16 @@ public function testDrupal6MigratedPasswordRehashing() { } /** - * Test Drupal 7 passwords rehashing. + * Test Drupal 7 or early Drupal 8 passwords rehashing. */ - public function testDrupal7MigratedPasswordRehashing() { + public function testDrupal7PasswordRehashing() { /** @var \Drupal\user\UserInterface $account */ $account = $this->drupalCreateUser(); $plain = $account->pass_raw; // We pretend that the user was migrated from Drupal 7. $d7_pass = $this->drupal7PasswordHasher->hash($plain); - $salt = substr($d7_pass, 0, 12); - $migrated_pass = 'D7' . $salt . $this->passwordHasher->hash($d7_pass); - $this->storeHashedPassword($account, $migrated_pass); + $this->storeHashedPassword($account, $d7_pass); // User first login after migration. $this->drupalLogin($account);