Moodle

Unit tests give spurious exceptions when $CFG->debugdisplay is false.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Unit tests
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

The problem is that when $CFG->debugdisplay is false, debugging calls trigger_error. The unit test framework reports all calls to trigger_error as exceptions.

Activity

Hide
Tim Hunt added a comment -

The best solution I can see is to display all debugging messages on-screen during unit testing.

The only alternative would be to ignore debugging messages completely during unit tests when $CFG->debugdisplay is false, and that seems like a worse option.

Fix checked in, with a comment pointing to this bug.

Show
Tim Hunt added a comment - The best solution I can see is to display all debugging messages on-screen during unit testing. The only alternative would be to ignore debugging messages completely during unit tests when $CFG->debugdisplay is false, and that seems like a worse option. Fix checked in, with a comment pointing to this bug.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: