The assert message checking for the success message in drupalLogin() uses the placeholder 'name' instead of '%name'. This leads to an error when the test fails (or when the message is displayed for any other reason.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review
FileSize
1.16 KB

This fixes the bug, and also two deprecated method calls in the same line.

Chi’s picture

Priority: Normal » Minor
Status: Needs review » Needs work
Issue tags: +Needs reroll

The following code can be used to reproduce the error.

$user = $this->drupalCreateUser();
$user->block()->save();
$this->drupalLogin($user);
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -8,6 +8,7 @@
 use Drupal\Component\Utility\SafeMarkup;

This statement becomes unused.

Chi’s picture

Issue tags: +Novice
amoebanath’s picture

Assigned: Unassigned » amoebanath
amoebanath’s picture

Assigned: amoebanath » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll, -Novice
FileSize
1.14 KB

Re-rolled!

Chi’s picture

Status: Needs review » Needs work

@amoebanath, since we remove SafeMarkup can you check if its use statement is still needed?

amoebanath’s picture

Status: Needs work » Needs review
FileSize
1.25 KB

Yep, don't need it. New patch!

Chi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

  • catch committed 8ec7fdc on 8.3.x
    Issue #2832052 by amoebanath, drunken monkey: BrowserTestBase::...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.3.x, thanks!

  • catch committed 8ec7fdc on 8.4.x
    Issue #2832052 by amoebanath, drunken monkey: BrowserTestBase::...

  • catch committed 8ec7fdc on 8.4.x
    Issue #2832052 by amoebanath, drunken monkey: BrowserTestBase::...

Status: Fixed » Closed (fixed)

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