mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-19057 fixed incorrect use of conditions
This commit is contained in:
parent
ebb8d35846
commit
4a8b5434e5
@ -3014,8 +3014,8 @@ class dml_test extends UnitTestCase {
|
||||
$this->assertEqual(1, reset($records)->id);
|
||||
$this->assertEqual(2, next($records)->id);
|
||||
|
||||
// try embeding sql_xxxx() helper functions, to check they don't break params/binding
|
||||
$count = $DB->count_records($tablename, array('course' => 3, $DB->sql_compare_text('content') => 'hello'));
|
||||
// do NOT try embedding sql_xxxx() helper functions in conditions array of count_records(), they don't break params/binding!
|
||||
$count = $DB->count_records_select($tablename, "course = :course AND ".$DB->sql_compare_text('content')." = :content", array('course' => 3, 'content' => 'hello'));
|
||||
$this->assertEqual(1, $count);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user