MDL-45323 grade: Unit test for grade_get_grade_items_for_activity()
authorSimey Lameze <lameze@gmail.com>
Thu, 15 May 2014 07:00:56 +0000 (15:00 +0800)
committerSimey Lameze <lameze@gmail.com>
Thu, 15 May 2014 07:00:56 +0000 (15:00 +0800)
grade/tests/querylib_test.php

index dca1a9e..c284123 100644 (file)
@@ -50,4 +50,15 @@ class core_grade_querylib_testcase extends advanced_testcase {
         $this->assertEquals(1, count($cms));
         $this->assertTrue(isset($cms[$forum1->cmid]));
     }
+
+    public function test_grade_get_grade_items_for_activity() {
+        $this->resetAfterTest(true);
+
+        $course = $this->getDataGenerator()->create_course();
+        $forum = $this->getDataGenerator()->create_module('forum', array('course'=>$course->id));
+        $cm = get_coursemodule_from_id('forum', $forum->cmid, $forum->course);
+        unset($cm->modname);
+        $grade = grade_get_grade_items_for_activity($cm);
+
+    }
 }