mirror of
https://github.com/moodle/moodle.git
synced 2025-02-25 20:43:33 +01:00
31 lines
624 B
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();
|
|
}
|
|
|
|
}
|
|
?>
|