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

Allow to unittest dashboard events WITH module callbacks

    XMLWordPrintable

    Details

      Description

      Discovered while working on MDL-58867, I tried to cover the problem with unittests but it did not work because unittests substitute the callback
      https://github.com/moodle/moodle/blob/master/calendar/classes/local/event/container.php#L100

      Therefore the code that had an error and was actually changed in MDL-58867 is completely impossible to unittests.

      At least we could add some option/setting that allows to use 'production' callback inside unittests.
      I would also vote for completely removing this production/testing switch because it is not how moodle works everywhere else, it is not expected by developers. I myself spent lots of time trying to understand why my events are not filtered when they should be in the unittest and was trying to find an non-existing error in my code

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Ryan Wyllie
              Integrator:
              Jun Pataleta
              Tester:
              John Okely
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Jul/17