function invoke($method) {
$queue = &$this->_createErrorQueue();
set_error_handler('SimpleTestErrorHandler');
- parent::invoke($method);
+ //moodle hack start
+ // note: this breaks PHP4 compatibility!
+ $rethrow = null;
+ try {
+ parent::invoke($method);
+ } catch (Exception $e) {
+ $rethrow = $e;
+ }
restore_error_handler();
$queue->tally();
+ if ($rethrow) {
+ throw $rethrow;
+ }
+ //moodle hack end
}
/**
*/
function invoke($method) {
$this->_test_case->setUp();
- $this->_test_case->$method();
+ // moodle hack start
+ // note: this breaks PHP4 compatibility!
+ $rethrow = null;
+ try {
+ $this->_test_case->$method();
+ } catch (Exception $e) {
+ $rethrow = $e;
+ }
$this->_test_case->tearDown();
+ if ($rethrow) {
+ throw $rethrow;
+ }
+ // moodle hack end
}
/**
Changes:
* test_case.php - added our global $CFG before include() MDL-10064
+ * fixed exception support (MDL-17534) - try/catch in invoker.php and errors.php
skodak