2

I'm implementing some tests using the D7 testing framework.

All is good, except that the numbers don't seem to add up, and I wondered how pass/fail was evaluated?

The problem is that I'm getting "6 passes, 0 fails, 4 exceptions, and 2 debug messages" for two test methods.

Obviously I'm missing something, but I had assumed that a single test method would produce a single pass/fail and therefore I should only have two results.

Secondly, how can I find out more information about the exceptions that were reported?

Thanks everyone.

2 Answers 2

5

Each assert()ion you have in your test code will result in a pass, fail or even an exception. The uncaught exceptions are bad fails.

If you're running your tests with scripts/run-tests.sh, then use the --verbose flag and you'll be able to see the result of each assertion and any associated error/s.

1
  • Thanks Dave, that makes sense. I'd vote up, but it seems I need more rep.
    – iainp999
    Commented Sep 12, 2011 at 8:18
2

Many, many internal methods run asserts, even setup. Almost all drupal* methods do, for example, drupalCreateUser, drupalCreateUser, drupalLogin, drupalGet'drupalPost`.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.