The code starting at line 504 reads:
if (count($classes) == 0) {
drupal_set_message('No test cases found.', 'error');
return FALSE;
}
return $classes;
}
However $classes is not set in all code-paths. It either needs to be initialized at the top, or checked with !isset at the bottom. With this change, simpletest/tests/block.test goes "110 passes, 0 fails, and 0 exceptions" with E_ALL.
See attachment for the initialization approach.
| Comment | File | Size | Author |
|---|---|---|---|
| simpletest.fixnotice.patch | 718 bytes | lyricnz |
Comments
Comment #1
lyricnz commentedWhoops, cnr.
Comment #2
boombatower commentedAs I commented http://drupal.org/node/442332#comment-1525776 shouldn't it effect D7 as well?
Seems like the code is fundamentally flawed...in that it caches $formatted_classes, but returns $classes.
I was planning on re-working this function in Drupal 7 (soon), so perhaps I should just do that.
Comment #3
lyricnz commentedYeah, now that I look at it - the code doesn't make any sense, and will return array() every time it's called (except the first).
Looks like it was broken by this change on March 31 (the static getInfo()).
Should we raise a new issue, or retask this one?
Comment #4
boombatower commentedI plan to re-work the function and all the places it is called shortly.
Waiting on my first cleanup: #445950: SimpleTest interface separation and cleanup.
Comment #5
boombatower commentedThis issue should fix problem: #449198: SimpleTest: Clean up test loading and related API
Comment #6
lyricnz commentedAny plans to backport that change?
Comment #7
Stalski commentedsubscribing
Comment #8
hotelfoo commentedsubscribing
Comment #9
boombatower commentedShould be fixed with latest backport.