Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54613

Missing iteminstance in unit test

XMLWordPrintable

      The test in sub_test_update_final_grade() in lib/grade/tests/grade_item_test.php creates a grade_item with itemtype and itemmodule set (to "mod" and "quiz" respectively), but no iteminstance.

      As far as I can see, if these are set then iteminstance should also be set. Obviously this test passes as-is, but if there are any third-party modules which handle \core\event\user_graded they will be getting an event object state that they wouldn't be expected to handle in actual running of the system.

      The attached patch just adds the iteminstance of the existing quiz to the new grade_item.

            maherne Michael Aherne
            maherne Michael Aherne
            Rajesh Taneja Rajesh Taneja
            David Monllaó David Monllaó
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.