MDL-14967 Upgraded gradebook code and unit tests. 4 failing tests in grade_item to fix.

This commit is contained in:
nicolasconnault
2008-05-23 14:52:50 +00:00
parent 3a4ff63b31
commit da3801e84b
12 changed files with 775 additions and 743 deletions
+5 -3
View File
@@ -77,21 +77,23 @@ class grade_scale_test extends grade_test {
}
function test_grade_scale_update() {
global $DB;
$grade_scale = new grade_scale($this->scale[0]);
$this->assertTrue(method_exists($grade_scale, 'update'));
$grade_scale->name = 'Updated info for this unittest grade_scale';
$this->assertTrue($grade_scale->update());
$name = get_field('scale', 'name', 'id', $this->scale[0]->id);
$name = $DB->get_field('scale', 'name', array('id' => $this->scale[0]->id));
$this->assertEqual($grade_scale->name, $name);
}
function test_grade_scale_delete() {
global $DB;
$grade_scale = new grade_scale($this->scale[0]);
$this->assertTrue(method_exists($grade_scale, 'delete'));
$this->assertTrue($grade_scale->delete());
$this->assertFalse(get_record('scale', 'id', $grade_scale->id));
$this->assertFalse($DB->get_record('scale', array('id' => $grade_scale->id)));
}
function test_grade_scale_fetch() {