Problem/Motivation

While debugging #2226533: Changes to the Language class due to the LanguageInterface (followup) I looked at the a failing test with the text Found English variant of tip 1. and I was
for a moment confused about exactly what was broken because of the assertion text was duplicated and I had to figure out
which test was broken and which test was not.

    $this->assertEqual(count($elements), 1,<strong> 'Found English variant of tip 1.'</strong>);

    // Navigate to tour-test-3 and verify the tour_test_1 tip is not found with
    // appropriate classes.
    $this->drupalGet('tour-test-3/bar');
    $elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./h2[contains(., :text)]]', array(
      ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1',
      ':data_id' => 'tour-test-1',
      ':text' => 'The first tip',
    ));
    $this->assertEqual(count($elements), 0, <strong>'Found English variant of tip 1.'</strong>);

clearly the second assertEquals shown above if mislabeled because it is looking for a count of 0

and should read something like 'Did not find English variant of tip 1'

Remaining tasks

none

User interface changes

none

API changes

none

CommentFileSizeAuthor
duplicate-0.patch540 bytesmartin107

Comments

martin107’s picture

Status: Active » Needs review
larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Thanks

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

  • Dries committed bd9eef3 on 8.x
    Issue #2289059 by martin107: Fixed duplicate assertion text is causing...

Status: Fixed » Closed (fixed)

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