diff --git a/core/modules/user/tests/src/Functional/UserCancelTest.php b/core/modules/user/tests/src/Functional/UserCancelTest.php index 16a2f6d82a..b4b985be5e 100644 --- a/core/modules/user/tests/src/Functional/UserCancelTest.php +++ b/core/modules/user/tests/src/Functional/UserCancelTest.php @@ -628,14 +628,11 @@ public function testUserAnonymizeTranslations() { // Rebuild the container to update the default language container variable. $this->rebuildContainer(); - // Create a user. $account = $this->drupalCreateUser(['cancel account']); $this->drupalLogin($account); - // Load a real user object. $user_storage->resetCache([$account->id()]); $account = $user_storage->load($account->id()); - // Create a simple node. $node = $this->drupalCreateNode(['uid' => $account->id()]); // Add a comment to the page. @@ -678,11 +675,12 @@ public function testUserAnonymizeTranslations() { $storage = \Drupal::entityTypeManager()->getStorage('comment'); $storage->resetCache([$comment->id()]); $test_comment = $storage->load($comment->id()); - $this->assertTrue(($test_comment->getOwnerId() == 0 && $test_comment->isPublished()), 'Comment of the user has been attributed to anonymous user.'); - $this->assertEqual($test_comment->getAuthorName(), $anonymous_user->getDisplayName(), 'Comment of the user has been attributed to anonymous user name.'); + $this->assertTrue($test_comment->getOwnerId() == 0); + $this->assertTrue($test_comment->isPublished(), 'Comment of the user has been attributed to anonymous user.'); + $this->assertEqual($test_comment->getAuthorName(), $anonymous_user->getDisplayName()); $comment_translation = $test_comment->getTranslation('ur'); $this->assertTrue(($comment_translation->getOwnerId() == 0 && $comment_translation->isPublished()), 'Comment translation of the user has been attributed to anonymous user.'); - $this->assertEqual($comment_translation->getAuthorName(), $anonymous_user->getDisplayName(), 'Comment translation of the user has been attributed to anonymous user name.'); + $this->assertEqual($comment_translation->getAuthorName(), $anonymous_user->getDisplayName()); // Confirm that the confirmation message made it through to the end user. $this->assertRaw(t('%name has been deleted.', ['%name' => $account->getAccountName()]));