From dd1611a5bdc130b49f83fcc8c03fed815062ac0c Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 9 Sep 2009 13:21:08 +0000 Subject: [PATCH] Pair number of DML tests in all DB, no matter if regexp is supported or no --- lib/dml/simpletest/testdml.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index 50d108f4c7..5e7af73b76 100755 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -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'); + } } -- 2.39.5