mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-52286 core: several fixes to ADOdb
This commit is contained in:
parent
bca69f937c
commit
cc3048eb41
5 changed files with 23 additions and 3 deletions
|
@ -381,4 +381,22 @@ class auth_db_testcase extends advanced_testcase {
|
|||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the function _colonscope() from ADOdb.
|
||||
*/
|
||||
public function test_adodb_colonscope() {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/adodb/adodb.inc.php');
|
||||
require_once($CFG->libdir.'/adodb/drivers/adodb-odbc.inc.php');
|
||||
require_once($CFG->libdir.'/adodb/drivers/adodb-db2ora.inc.php');
|
||||
|
||||
$this->resetAfterTest(false);
|
||||
|
||||
$sql = "select * from table WHERE column=:1 AND anothercolumn > :0";
|
||||
$arr = array('b', 1);
|
||||
list($sqlout, $arrout) = _colonscope($sql,$arr);
|
||||
$this->assertEquals("select * from table WHERE column=? AND anothercolumn > ?", $sqlout);
|
||||
$this->assertEquals(array(1, 'b'), $arrout);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue