Problem/Motivation

A follow up to to #2924538: [META] Remove all usages of drupal_set_message and drupal_get_messages fix the naming of:

  • The system_test.drupal_set_message route
  • The /system-test/drupal-set-message path
  • The SystemTestController::drupalSetMessageTest() method
  • The \Drupal\Tests\system\Functional\Bootstrap\DrupalSetMessageTest() test class

None of these things test drupal_set_message() anymore.

Proposed resolution

Update the naming so it no longer directly references the refactored drupal_set_message() function.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

voleger’s picture

Status: Active » Needs review
FileSize
3.41 KB
martin107’s picture

Status: Needs review » Reviewed & tested by the community

The idea behind the issue is sound.
All these changes are good.
There are no coding standard errors in the test results.

so +1 from me.

idebr’s picture

Updated the parent issue reference to #2924538: [META] Remove all usages of drupal_set_message and drupal_get_messages


+++ b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
@@ -19,12 +20,12 @@ class DrupalSetMessageTest extends BrowserTestBase {
-  public function testDrupalSetMessage() {
-    // The page at system-test/drupal-set-message sets two messages and then
-    // removes the first before it is displayed.
-    $this->drupalGet('system-test/drupal-set-message');
+  public function testDrupalMessengerService() {
+    // The page at system_test.messenger_service route sets two messages and
+    // then removes the first before it is displayed.
+    $this->drupalGet(Url::fromRoute('system_test.messenger_service'));

Not sure this change is necessary, but since drupalGet() takes a Url or a path string, I suppose it does not matter all that much.

alexpott’s picture

We need to fix the classdoc of DrupalMessengerServiceTest...

/**
 * Tests drupal_set_message() and related functions.
 *
 * @group Bootstrap
 */
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0074150 and pushed to 8.6.x. Thanks!

diff --git a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
index e91ac9ac0e..51404ef18d 100644
--- a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
+++ b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
@@ -6,7 +6,7 @@
 use Drupal\Tests\BrowserTestBase;
 
 /**
- * Tests drupal_set_message() and related functions.
+ * Tests the Messenger service.
  *
  * @group Bootstrap
  */

Fixed on commit.

  • alexpott committed 0074150 on 8.6.x
    Issue #2971145 by voleger: Fix naming of tests referencing the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.