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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.4
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    3/Dec/12