コード例 #1
0
 /**
  * Method called after each test method. Doesn't do anything extraordinary except restore the global $DB to the real one.
  */
 public function tearDown()
 {
     $CFG->enableavailability = $this->oldcfg->enableavailability;
     $CFG->enablecompletion = $this->oldcfg->enablecompletion;
     parent::tearDown();
 }
コード例 #2
0
 /**
  * Drop test tables from DB.
  */
 function tearDown()
 {
     // delete the contents of tables before the test run - the unit test might fail on fatal error and the data would not be deleted!
     foreach ($this->grade_tables as $table) {
         unset($this->{$table});
     }
     parent::tearDown();
 }