mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
Merge branch 'w04_MDL-43903_m27_mssqltests' of https://github.com/skodak/moodle
This commit is contained in:
commit
5eb041021e
2 changed files with 17 additions and 0 deletions
|
@ -28,11 +28,17 @@ defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
|
||||||
class auth_db_testcase extends advanced_testcase {
|
class auth_db_testcase extends advanced_testcase {
|
||||||
|
/** @var string Original error log */
|
||||||
|
protected $oldlog;
|
||||||
|
|
||||||
protected function init_auth_database() {
|
protected function init_auth_database() {
|
||||||
global $DB, $CFG;
|
global $DB, $CFG;
|
||||||
require_once("$CFG->dirroot/auth/db/auth.php");
|
require_once("$CFG->dirroot/auth/db/auth.php");
|
||||||
|
|
||||||
|
// Discard error logs from AdoDB.
|
||||||
|
$this->oldlog = ini_get('error_log');
|
||||||
|
ini_set('error_log', "$CFG->dataroot/testlog.log");
|
||||||
|
|
||||||
$dbman = $DB->get_manager();
|
$dbman = $DB->get_manager();
|
||||||
|
|
||||||
set_config('extencoding', 'utf-8', 'auth/db');
|
set_config('extencoding', 'utf-8', 'auth/db');
|
||||||
|
@ -133,6 +139,8 @@ class auth_db_testcase extends advanced_testcase {
|
||||||
$dbman = $DB->get_manager();
|
$dbman = $DB->get_manager();
|
||||||
$table = new xmldb_table('auth_db_users');
|
$table = new xmldb_table('auth_db_users');
|
||||||
$dbman->drop_table($table);
|
$dbman->drop_table($table);
|
||||||
|
|
||||||
|
ini_set('error_log', $this->oldlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_plugin() {
|
public function test_plugin() {
|
||||||
|
|
|
@ -31,9 +31,16 @@ class enrol_database_testcase extends advanced_testcase {
|
||||||
protected static $users = array();
|
protected static $users = array();
|
||||||
protected static $roles = array();
|
protected static $roles = array();
|
||||||
|
|
||||||
|
/** @var string Original error log */
|
||||||
|
protected $oldlog;
|
||||||
|
|
||||||
protected function init_enrol_database() {
|
protected function init_enrol_database() {
|
||||||
global $DB, $CFG;
|
global $DB, $CFG;
|
||||||
|
|
||||||
|
// Discard error logs from AdoDB.
|
||||||
|
$this->oldlog = ini_get('error_log');
|
||||||
|
ini_set('error_log', "$CFG->dataroot/testlog.log");
|
||||||
|
|
||||||
$dbman = $DB->get_manager();
|
$dbman = $DB->get_manager();
|
||||||
|
|
||||||
set_config('dbencoding', 'utf-8', 'enrol_database');
|
set_config('dbencoding', 'utf-8', 'enrol_database');
|
||||||
|
@ -160,6 +167,8 @@ class enrol_database_testcase extends advanced_testcase {
|
||||||
self::$courses = null;
|
self::$courses = null;
|
||||||
self::$users = null;
|
self::$users = null;
|
||||||
self::$roles = null;
|
self::$roles = null;
|
||||||
|
|
||||||
|
ini_set('error_log', $this->oldlog);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function reset_enrol_database() {
|
protected function reset_enrol_database() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue