diff --git a/core/modules/user/src/Form/UserLogoutConfirm.php b/core/modules/user/src/Form/UserLogoutConfirm.php index df2b1e27eb10212ae9b910aaf2ce1a89ad038d76..c681db62e059b809f66c1861cf9439f1455c3edf 100644 --- a/core/modules/user/src/Form/UserLogoutConfirm.php +++ b/core/modules/user/src/Form/UserLogoutConfirm.php @@ -22,6 +22,14 @@ public function getConfirmText(): TranslatableMarkup { return $this->t('Log out'); } + /** + * {@inheritdoc} + */ + public function getDescription() { + // phpcs:ignore Drupal.Semantics.FunctionT.EmptyString + return $this->t(''); + } + /** * {@inheritdoc} */ diff --git a/core/modules/user/tests/src/Functional/UserLogoutTest.php b/core/modules/user/tests/src/Functional/UserLogoutTest.php index 952b15b0711f137fa8a271a90fc8127e99690683..5630ff1f527c2f7a311c74d4834a5c42ede8c4df 100644 --- a/core/modules/user/tests/src/Functional/UserLogoutTest.php +++ b/core/modules/user/tests/src/Functional/UserLogoutTest.php @@ -50,6 +50,9 @@ public function testLogout(): void { $this->drupalGet($logoutUrl, ['query' => ['token' => '123']]); $this->assertTrue($this->drupalUserIsLoggedIn($account)); $this->assertSession()->addressEquals($confirmUrl); + // Test to ensure the text 'This action cannot be undone.' is not + // present on the page. + $this->assertSession()->pageTextNotContains('This action cannot be undone.'); // Submitting the confirmation form correctly logs the user out. $this->submitForm([], 'Log out'); $this->assertFalse($this->drupalUserIsLoggedIn($account));