Problem/Motivation

Noticed by @alexpott in #2340667-45: Protect Drupal\Core\Language\Language::id, and use getId()

+++ b/core/modules/user/src/Tests/UserInstallTest.php
@@ -47,8 +47,8 @@ public function testUserInstall() {
-    $this->assertEqual($anon->langcode, \Drupal::languageManager()->getDefaultLanguage()->id);
-    $this->assertEqual($admin->langcode, \Drupal::languageManager()->getDefaultLanguage()->id);
+    $this->assertEqual($anon->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Anon user language is the default.');
+    $this->assertEqual($admin->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Admin user language is the default.');
The test assertion message here is less useful to a developer than the default - which would tell you what the two langcodes are.

Proposed resolution

Take out the custom assert message.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Create a patch (novice) Instructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Instructions

User interface changes

No.

API changes

No.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

lhangea’s picture

Assigned: Unassigned » lhangea
lhangea’s picture

I will write and upload the patch with the correction in a few minutes :)

lhangea’s picture

here's the patch

lhangea’s picture

Status: Active » Needs review
skipyT’s picture

Status: Needs review » Reviewed & tested by the community

this seems ok for me. thanks Lucian!

rahul.shinde’s picture

FileSize
98.54 KB
YesCT’s picture

Assigned: lhangea » Unassigned

Thanks.

Let's leave this unassigned since I think there is nothing actionable right now.

  • webchick committed f1102d2 on 8.0.x
    Issue #2355545 by lhangea, alexpott | YesCT: UserInstallTest...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

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