From 0629a32e51c39fc9dc7cfbea0a120f09cf41d57a Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 22 Oct 2009 14:40:29 +0000 Subject: [PATCH] MDL-20624 fixed problem with PREV/NEXT dev hack in unittests --- lib/ddl/simpletest/testddl.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/ddl/simpletest/testddl.php b/lib/ddl/simpletest/testddl.php index eae22e32932..a2670043229 100755 --- a/lib/ddl/simpletest/testddl.php +++ b/lib/ddl/simpletest/testddl.php @@ -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'));