mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-14905 Added more unit tests, plus stubs for all methods to be tested. Also fixed a bug in moodle_database:get_recordset_list(), which was using " AND " between values instead of " OR "
This commit is contained in:
parent
a4736e2808
commit
0088bd3167
2 changed files with 265 additions and 27 deletions
|
@ -513,8 +513,7 @@ abstract class moodle_database {
|
|||
* Get a number of records a moodle_recordset.
|
||||
*
|
||||
* Only records where $field takes one of the values $values are returned.
|
||||
* $values should be a comma-separated list of values, for example "4,5,6,10"
|
||||
* or "'foo','bar','baz'".
|
||||
* $values must be an array of values.
|
||||
*
|
||||
* Other arguments and the return type as for @see function get_recordset.
|
||||
*
|
||||
|
@ -541,7 +540,7 @@ abstract class moodle_database {
|
|||
$params[] = $value;
|
||||
}
|
||||
}
|
||||
$select = implode(" AND ", $select);
|
||||
$select = implode(" OR ", $select);
|
||||
return $this->get_recordset_select($table, $select, $params, $sort, $fields, $limitfrom, $limitnum);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue