]> git.mjollnir.org Git - moodle.git/commitdiff
Pair number of DML tests in all DB, no matter if regexp is supported or no
authorstronk7 <stronk7>
Wed, 9 Sep 2009 13:21:08 +0000 (13:21 +0000)
committerstronk7 <stronk7>
Wed, 9 Sep 2009 13:21:08 +0000 (13:21 +0000)
lib/dml/simpletest/testdml.php

index 50d108f4c720fef54a8f9f32048d4d180f60f84d..5e7af73b76a5c94459605ee68e066c1904d2f629 100755 (executable)
@@ -1892,10 +1892,6 @@ class dml_test extends UnitTestCase {
         $DB = $this->tdb;
         $dbman = $DB->get_manager();
 
-        if (!$DB->sql_regex_supported()) {
-            return;
-        }
-
         $table = $this->get_test_table();
         $tablename = $table->getName();
 
@@ -1911,13 +1907,21 @@ class dml_test extends UnitTestCase {
 
         $sql = "SELECT * FROM {".$tablename."} WHERE name ".$DB->sql_regex()." ?";
         $params = array('a$');
-        $records = $DB->get_records_sql($sql, $params);
-        $this->assertEqual(count($records), 2);
+        if ($DB->sql_regex_supported()) {
+            $records = $DB->get_records_sql($sql, $params);
+            $this->assertEqual(count($records), 2);
+        } else {
+            $this->assertTrue(true, 'Regexp operations not supported. Test skipped');
+        }
 
         $sql = "SELECT * FROM {".$tablename."} WHERE name ".$DB->sql_regex(false)." ?";
         $params = array('.a');
-        $records = $DB->get_records_sql($sql, $params);
-        $this->assertEqual(count($records), 1);
+        if ($DB->sql_regex_supported()) {
+            $records = $DB->get_records_sql($sql, $params);
+            $this->assertEqual(count($records), 1);
+        } else {
+            $this->assertTrue(true, 'Regexp operations not supported. Test skipped');
+        }
 
     }