From d3fee2051a32e2725598f1ed5a770ab073294c9d Mon Sep 17 00:00:00 2001
From: quietone <quietone@2572884.no-reply.drupal.org>
Date: Wed, 27 Sep 2023 13:08:24 +1300
Subject: [PATCH] Issue #3389923 by catch, smustgrave: Consolidate a couple of
 methods in DemoUmamiTest

---
 .../src/Functional/DemoUmamiProfileTest.php   | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
index b10365697d26..246b555153f2 100644
--- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
@@ -38,10 +38,23 @@ protected function installParameters() {
    */
   protected $profile = 'demo_umami';
 
+  /**
+   * Tests some features specific to being a demonstration profile.
+   */
+  public function testDemoSpecificFeatures() {
+    // This test coverage is organized into separate protected methods rather
+    // than individual test methods to avoid having to reinstall Umami for
+    // a handful of assertions each.
+    $this->testUser();
+    $this->testWarningsOnStatusPage();
+    $this->testAppearance();
+    $this->testDemonstrationWarningMessage();
+  }
+
   /**
    * Tests demo_umami profile warnings shown on Status Page.
    */
-  public function testWarningsOnStatusPage() {
+  protected function testWarningsOnStatusPage() {
     $account = $this->drupalCreateUser(['administer site configuration']);
     $this->drupalLogin($account);
 
@@ -129,7 +142,7 @@ protected function assertDefaultConfig(StorageInterface $default_config_storage,
   /**
    * Tests that the users can log in with the admin password entered at install.
    */
-  public function testUser() {
+  protected function testUser() {
     $password = $this->rootUser->pass_raw;
     $ids = \Drupal::entityQuery('user')
       ->accessCheck(FALSE)
@@ -176,7 +189,7 @@ public function testEditNodesByAdmin() {
   /**
    * Tests that the Umami theme is available on the Appearance page.
    */
-  public function testAppearance() {
+  protected function testAppearance() {
     $account = $this->drupalCreateUser(['administer themes']);
     $this->drupalLogin($account);
     $webassert = $this->assertSession();
@@ -188,7 +201,7 @@ public function testAppearance() {
   /**
    * Tests that the toolbar warning only appears on the admin pages.
    */
-  public function testDemonstrationWarningMessage() {
+  protected function testDemonstrationWarningMessage() {
     $permissions = [
       'access content overview',
       'access toolbar',
-- 
GitLab