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

Cannot run PHP unit tests for the new assignment module web services

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3.2
    • 2.4
    • Assignment
    • MOODLE_23_STABLE
    • MOODLE_24_STABLE
    • Hide

      To reproduce the problem:
      Run the php unit tests for the assignment web services created in MDL-31873 or MDL-31683. The tests will fail with a message saying that function assign_add_instance cannot accept a null value
      To test that the modifications in this issue have resolved the issue:
      Run the php unit tests again. The tests should run successfully

      Show
      To reproduce the problem: Run the php unit tests for the assignment web services created in MDL-31873 or MDL-31683 . The tests will fail with a message saying that function assign_add_instance cannot accept a null value To test that the modifications in this issue have resolved the issue: Run the php unit tests again. The tests should run successfully

    Description

      Two problems are preventing PHP unit tests from working. These are:

      1) The tests generator cannot create an instance of the assign module because the assign_add_instance constructor in mod/assign/lib.php does not allow a null mod_assign_mod_form parameter. This can be resolved with the following modification

      function assign_add_instance(stdClass $data, mod_assign_mod_form $form = null)

      2) mod/assign/locallib.php needs to be modified to resolve the problem described in MDL-27968. The proposed solution is to lazily initialise the renderer which could be done by creating a new private function get_output which performs the initialisation and then replacing all calls to $this->output with a call to get_output

      Attachments

        Issue Links

          Activity

            People

              damyon Damyon Wiese
              pcharsle Paul Charsley
              Damyon Wiese Damyon Wiese
              Dan Poltawski Dan Poltawski
              Tim Barker Tim Barker
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/12