Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | Test_result.png | 98.54 KB | rahul.shinde |
#4 | custom-assert-message-removed-2355545-4.patch | 992 bytes | lhangea |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedComment #2
lhangea CreditAttribution: lhangea commentedComment #3
lhangea CreditAttribution: lhangea commentedI will write and upload the patch with the correction in a few minutes :)
Comment #4
lhangea CreditAttribution: lhangea commentedhere's the patch
Comment #5
lhangea CreditAttribution: lhangea commentedComment #6
skipyT CreditAttribution: skipyT commentedthis seems ok for me. thanks Lucian!
Comment #7
rahul.shindeComment #8
YesCT CreditAttribution: YesCT commentedThanks.
Let's leave this unassigned since I think there is nothing actionable right now.
Comment #10
webchickCommitted and pushed to 8.0.x. Thanks!