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.

CommentFileSizeAuthor
simpletest.fixnotice.patch718 byteslyricnz

Comments

lyricnz’s picture

Status: Active » Needs review

Whoops, cnr.

boombatower’s picture

As 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.

lyricnz’s picture

Yeah, 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?

boombatower’s picture

Status: Needs review » Postponed

I 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.

boombatower’s picture

lyricnz’s picture

Any plans to backport that change?

Stalski’s picture

subscribing

hotelfoo’s picture

subscribing

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Postponed » Fixed

Should be fixed with latest backport.

Status: Fixed » Closed (fixed)

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