]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20624 fixed problem with PREV/NEXT dev hack in unittests
authorskodak <skodak>
Thu, 22 Oct 2009 14:40:29 +0000 (14:40 +0000)
committerskodak <skodak>
Thu, 22 Oct 2009 14:40:29 +0000 (14:40 +0000)
lib/ddl/simpletest/testddl.php

index eae22e32932d9772750f9aebff5b2b2c730c5bcb..a267004322934b3dad4b8f906b2fe3791ca57ebf 100755 (executable)
@@ -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'));