mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-49244-master' of git://github.com/jleyva/moodle
This commit is contained in:
commit
e51f7a6a20
2 changed files with 11 additions and 1 deletions
|
@ -1552,7 +1552,7 @@ class core_course_external extends external_api {
|
|||
}
|
||||
|
||||
if (isset($value)) {
|
||||
$conditions[$key] = $crit['value'];
|
||||
$conditions[$key] = $value;
|
||||
$wheres[] = $key . " = :" . $key;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,6 +234,16 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
|||
|
||||
$this->assertEquals(1, count($categories));
|
||||
|
||||
// Same query, but forcing a parameters clean.
|
||||
$categories = core_course_external::get_categories(array(
|
||||
array('key' => 'id', 'value' => "$category1->id"),
|
||||
array('key' => 'idnumber', 'value' => $category1->idnumber),
|
||||
array('key' => 'name', 'value' => $category1->name . "<br/>"),
|
||||
array('key' => 'visible', 'value' => '1')), 0);
|
||||
$categories = external_api::clean_returnvalue(core_course_external::get_categories_returns(), $categories);
|
||||
|
||||
$this->assertEquals(1, count($categories));
|
||||
|
||||
// Retrieve categories from parent.
|
||||
$categories = core_course_external::get_categories(array(
|
||||
array('key' => 'parent', 'value' => $category3->id)), 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue