diff core/modules/user/tests/src/Functional/UserEditTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children af1871eacc83
line wrap: on
line diff
--- a/core/modules/user/tests/src/Functional/UserEditTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/modules/user/tests/src/Functional/UserEditTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\user\Functional;
 
+use Drupal\Core\Cache\Cache;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -29,9 +30,15 @@
     // is the raw value and not a formatted one.
     \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
     \Drupal::service('module_installer')->install(['user_hooks_test']);
+    Cache::invalidateTags(['rendered']);
     $this->drupalGet('user/' . $user1->id() . '/edit');
     $this->assertFieldByName('name', $user1->getAccountName());
 
+    // Ensure the formatted name is displayed when expected.
+    $this->drupalGet('user/' . $user1->id());
+    $this->assertSession()->responseContains($user1->getDisplayName());
+    $this->assertSession()->titleEquals(strip_tags($user1->getDisplayName()) . ' | Drupal');
+
     // Check that filling out a single password field does not validate.
     $edit = [];
     $edit['pass[pass1]'] = '';