mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-45062 webservices: fix unit test for update_grades
This fixes the broken unit test (which exposes a fail) and the next patch from Juan fixes the fail.
This commit is contained in:
parent
0cbd1f913d
commit
63c61733f0
@ -284,6 +284,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
|
||||
array(),
|
||||
array('hidden' => 1)
|
||||
);
|
||||
$result = external_api::clean_returnvalue(core_grades_external::update_grades_returns(), $result);
|
||||
$this->assertTrue($result == GRADE_UPDATE_OK);
|
||||
|
||||
// Check it's definitely hidden.
|
||||
@ -409,6 +410,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
|
||||
array(),
|
||||
array('grademax' => $changedmax)
|
||||
);
|
||||
$result = external_api::clean_returnvalue(core_grades_external::update_grades_returns(), $result);
|
||||
$this->assertTrue($result == GRADE_UPDATE_OK);
|
||||
$grades = grade_get_grades($course->id, 'mod', 'assign', $assignment->id);
|
||||
$this->assertTrue($grades->items[0]->grademax == $changedmax);
|
||||
@ -423,6 +425,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
|
||||
0,
|
||||
array(array('studentid' => $student1->id, 'grade' => $student1grade))
|
||||
);
|
||||
$result = external_api::clean_returnvalue(core_grades_external::update_grades_returns(), $result);
|
||||
$this->assertTrue($result == GRADE_UPDATE_OK);
|
||||
$grades = grade_get_grades($course->id, 'mod', 'assign', $assignment->id, array($student1->id));
|
||||
$this->assertTrue($grades->items[0]->grades[$student1->id]->grade == $student1grade);
|
||||
@ -441,6 +444,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
|
||||
array('studentid' => $student2->id, 'grade' => $student2grade)
|
||||
)
|
||||
);
|
||||
$result = external_api::clean_returnvalue(core_grades_external::update_grades_returns(), $result);
|
||||
$this->assertTrue($result == GRADE_UPDATE_OK);
|
||||
$grades = grade_get_grades($course->id, 'mod', 'assign', $assignment->id, array($student1->id, $student2->id));
|
||||
$this->assertTrue($grades->items[0]->grades[$student1->id]->grade == $student1grade);
|
||||
@ -516,6 +520,7 @@ class core_grades_external_testcase extends externallib_advanced_testcase {
|
||||
array(),
|
||||
array('hidden' => 1)
|
||||
);
|
||||
$result = external_api::clean_returnvalue(core_grades_external::update_grades_returns(), $result);
|
||||
$this->assertTrue($result == GRADE_UPDATE_OK);
|
||||
$grades = grade_get_grades($course->id, 'mod', 'assign', $assignment->id);
|
||||
$this->assertTrue($grades->items[0]->hidden == 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user