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

Strange name collision in unit tests.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.4
    • Fix Version/s: 2.3.2, 2.4
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      You can reproduce the original problem by installing https://github.com/maths/moodle-qtype_stack and trying to run the unit tests. However, that is probably overkill.

      It is probably sufficient to just run the unit tests in core Moodle, to verify that this does not cause any regressions.

      Show
      You can reproduce the original problem by installing https://github.com/maths/moodle-qtype_stack and trying to run the unit tests. However, that is probably overkill. It is probably sufficient to just run the unit tests in core Moodle, to verify that this does not cause any regressions.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      1. At the moment, the init script generates test-cases like <testsuite name="@component@">. The problem with this is that if your plugin is called qtype_stack, and you have a class called qtype_stack, then sometimes it tries to create an instance of the class to use at the test site. That leads to a fatal error saying that qtype_stack is not an instance of whatever PHPunit class.

      The solution seems to be to change the testcase name to something like <testsuite name="@component@ test case"> which cannot possibly be a PHP class name.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12