From: stronk7 Date: Sun, 15 Feb 2009 23:43:34 +0000 (+0000) Subject: Fix tests (missing declaration) and add tests for sql_length() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=37d975e11f2f5bc8215a437376d5db6a7f8bef42;p=moodle.git Fix tests (missing declaration) and add tests for sql_length() --- diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index de18602e2e..9d8c8ab8da 100755 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -1761,6 +1761,14 @@ class dml_test extends UnitTestCase { } } + function test_sql_length() { + $DB = $this->tdb; + $this->assertEqual($DB->get_field_sql( + "SELECT ".$DB->sql_length("'aeiou'").$DB->sql_null_from_clause()), 5); + $this->assertEqual($DB->get_field_sql( + "SELECT ".$DB->sql_length("'áéíóú'").$DB->sql_null_from_clause()), 5); + } + function test_sql_position() { $DB = $this->tdb; $this->assertEqual($DB->get_field_sql( @@ -1959,6 +1967,7 @@ class moodle_database_for_testing extends moodle_database { protected function get_dbtype(){} protected function get_dblibrary(){} public function get_name(){} + public function get_configuration_help(){} public function get_configuration_hints(){} public function connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, array $dboptions=null){} public function get_server_info(){}