mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-20624 fixed problem with PREV/NEXT dev hack in unittests
This commit is contained in:
parent
dd800cea85
commit
0629a32e51
@ -1203,6 +1203,11 @@ class ddl_test extends UnitTestCase {
|
||||
}
|
||||
|
||||
// Real file but invalid xml file
|
||||
$devhack = false;
|
||||
if (!empty($CFG->xmldbdisablenextprevchecking)) {
|
||||
$CFG->xmldbdisablenextprevchecking = false;
|
||||
$devhack = true;
|
||||
}
|
||||
try {
|
||||
ob_start(); // hide debug warning
|
||||
$dbman->delete_tables_from_xmldb_file($CFG->libdir . '/ddl/simpletest/fixtures/invalid.xml');
|
||||
@ -1212,6 +1217,9 @@ class ddl_test extends UnitTestCase {
|
||||
ob_end_clean();
|
||||
$this->assertTrue($e instanceof moodle_exception);
|
||||
}
|
||||
if ($devhack) {
|
||||
$CFG->xmldbdisablenextprevchecking = true;
|
||||
}
|
||||
|
||||
// Check that the table has not been deleted from DB
|
||||
$this->assertTrue($dbman->table_exists('test_table1'));
|
||||
@ -1239,6 +1247,11 @@ class ddl_test extends UnitTestCase {
|
||||
}
|
||||
|
||||
// Real but invalid xml file
|
||||
$devhack = false;
|
||||
if (!empty($CFG->xmldbdisablenextprevchecking)) {
|
||||
$CFG->xmldbdisablenextprevchecking = false;
|
||||
$devhack = true;
|
||||
}
|
||||
try {
|
||||
ob_start(); // hide debug warning
|
||||
$dbman->install_from_xmldb_file($CFG->libdir.'/ddl/simpletest/fixtures/invalid.xml');
|
||||
@ -1248,6 +1261,9 @@ class ddl_test extends UnitTestCase {
|
||||
ob_end_clean();
|
||||
$this->assertTrue($e instanceof moodle_exception);
|
||||
}
|
||||
if ($devhack) {
|
||||
$CFG->xmldbdisablenextprevchecking = true;
|
||||
}
|
||||
|
||||
// Check that the table has not yet been created in DB
|
||||
$this->assertFalse($dbman->table_exists('test_table1'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user