Posted by Berdir on April 22, 2012 at 10:39pm
9 followers
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D7, Novice |
Issue Summary
Problem/Motivation
There is a wrong assertion in taxonomy.test that always evaluates to TRUE.
$this->assertTrue(count($terms4 == 4), 'Correct number of terms were loaded.');This is always TRUE. It should at least be count($terms4) == 4. However, it would be better to replace the assertion with assertEqual(): $this->assertEqual(count($terms4), 4, ...).
Proposed resolution
- Change the mentioned line of code to
assertEqual()and fix thecount(). - Look for other places in the file that could be done using assertEqual() instead of assertTrue() to simplify the code.
Remaining tasks
This should only be done once both #1160566: entity_load() is actually entity_load_multiple() and #1195254: Taxonomy test cleanup have been commited (the the second already has been commited to 8.x, only needs to be commited to 7.x, the first will not be backported) because both patches currently touch that line or come too close so that it will need a re-roll.
Comments
#1
Updated the summary.
#2
Here is a D7 patch for this.
#3
The last submitted patch, 1542674-d7.patch, failed testing.
#4
Ignore the last patch, too premature.
#5
Looks like it was just rolled against D7. :) It needs to be fixed in D8 first.
#6
Yep, I got it all wrong on this one I'm afraid :)
#7
Here is a D8 patch with assertEqual instead of assertTrue where appropriate.
#8
#9
Isn't this issue still waiting on other issues above?
#10
#7: 1542674-7.patch queued for re-testing.
#11
The last submitted patch, 1542674-7.patch, failed testing.
#12
Re-rolled to apply after #1160566: entity_load() is actually entity_load_multiple() has been commited
#13
Looks good to me.
#14
Nice catch, and good clean-up. Committed to 8.x. Moving to 7.x.
#15
It doesn't look like this was pushed to D8 yet.
#16
http://drupalcode.org/project/drupal.git/commit/ae015c9
#17
Rerolled.
#18
The last submitted patch, drupal-1542674-17.patch, failed testing.
#19
I mismatched the parenthesis on that weird count() line.
#20
Looks correct.
#21
wow, nice catch. committed and pushed to 7.x. thanks!
#22
Automatically closed -- issue fixed for 2 weeks with no activity.