MDL-37086 phpunit: use alt reset method.
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 28 Jan 2013 17:25:38 +0000 (18:25 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 28 Jan 2013 17:25:38 +0000 (18:25 +0100)
When code executed in test cases is using/preventing
database transactions, phpunit itself cannot
use transactions for reseting between cases. But we
can tell it about, so some alternative (and slower)
method for reseting will be used.

message/tests/externallib_test.php

index 37abe4d..9834769 100644 (file)
@@ -62,6 +62,8 @@ class core_message_external_testcase extends externallib_advanced_testcase {
         global $DB, $USER, $CFG;
 
         $this->resetAfterTest(true);
+        // Transactions used in tests, tell phpunit use alternative reset method.
+        $this->preventResetByRollback();
 
         // Turn off all message processors (so nothing is really sent)
         require_once($CFG->dirroot . '/message/lib.php');