moodle/lib/dml/simpletest/dbspecific.php

31 lines
624 B
PHP

<?php
class dbspecific_test extends UnitTestCase {
protected $tables = array();
protected $tdb;
protected $data;
function setUp() {
global $CFG, $DB, $UNITTEST;
if (isset($UNITTEST->func_test_db)) {
$this->tdb = $UNITTEST->func_test_db;
} else {
$this->tdb = $DB;
}
}
function tearDown() {
$dbman = $this->tdb->get_manager();
foreach ($this->tables as $table) {
if ($dbman->table_exists($table)) {
$dbman->drop_table($table);
}
}
$this->tables = array();
}
}
?>