diff -u b/core/modules/user/src/Tests/UserEntityCallbacksTest.php b/core/modules/user/src/Tests/UserEntityCallbacksTest.php --- b/core/modules/user/src/Tests/UserEntityCallbacksTest.php +++ b/core/modules/user/src/Tests/UserEntityCallbacksTest.php @@ -52,13 +52,13 @@ $this->config('user.settings')->set('anonymous', $name)->save(); $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0'); $this->assertEqual($this->anonymous->getDisplayName(), $name, 'The variable anonymous should be used for display name of uid 0'); - $this->assertEqual($this->anonymous->getDisplayName(), '', 'The raw anonymous user name should be empty string'); + $this->assertEqual($this->anonymous->getUsername(), '', 'The raw anonymous user name should be empty string'); // Set to test the altered username. \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE); $this->assertEqual($this->account->getDisplayName(), '' . $this->account->id() . '', 'The user display name should be altered.'); - $this->assertEqual($this->account->getDisplayName(), $this->account->name->value, 'The user name should not be altered.'); + $this->assertEqual($this->account->getUsername(), $this->account->name->value, 'The user name should not be altered.'); } }