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

Move reportlib_test.php to mod/quiz/tests/

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Quiz, Unit tests
    • Labels:
      None

      Description

      From Tim @ MDL-37684:

      This bit is wrong:

      <testsuite name="quiz_report">	
          <directory suffix="_test.php">mod/quiz/report/tests</directory>
      </testsuite>
      

      The correct fix there was to move mod/quiz/report/tests/reportlib_test.php to mod/quiz/tests/reportlib_test.php, since that is how Petr decided tests for plugins should work (all in one folder).

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited

            I don't get why that move is correct, but to avoid forgetting it, issue created.

            Edited: Tim explained me why the move is needed. The "home" of plugin/subplugin types is not a correct place for tests. Each plugin/subplugin own dir is.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - - edited I don't get why that move is correct, but to avoid forgetting it, issue created. Edited: Tim explained me why the move is needed. The "home" of plugin/subplugin types is not a correct place for tests. Each plugin/subplugin own dir is.
            Hide
            timhunt Tim Hunt added a comment -

            (10:26:45 AM) timhunt: Well, if you look at how the code to build the phpunit.xml file works, it assumes that all the tests for plugin X are in the /tests/ folder, not in /subdir/tests.
            (10:27:06 AM) Eloy: but isn't that a subplugin?
            (10:27:58 AM) timhunt: No, mod/quiz/report/xxx is a subplugins, and can have tests in mod/quiz/report/xxx/tests. mod/quiz/report is the part of the mod_quiz code that interfaces with those subplugins, so is part of the quiz.
            (10:28:48 AM) Eloy: ah, I though the "home" of subplugins was ok too
            (10:28:57 AM) timhunt: No.
            (10:29:03 AM) Eloy: aha, got it. thanks

            Show
            timhunt Tim Hunt added a comment - (10:26:45 AM) timhunt: Well, if you look at how the code to build the phpunit.xml file works, it assumes that all the tests for plugin X are in the /tests/ folder, not in /subdir/tests. (10:27:06 AM) Eloy: but isn't that a subplugin? (10:27:58 AM) timhunt: No, mod/quiz/report/xxx is a subplugins, and can have tests in mod/quiz/report/xxx/tests. mod/quiz/report is the part of the mod_quiz code that interfaces with those subplugins, so is part of the quiz. (10:28:48 AM) Eloy: ah, I though the "home" of subplugins was ok too (10:28:57 AM) timhunt: No. (10:29:03 AM) Eloy: aha, got it. thanks
            Hide
            timhunt Tim Hunt added a comment -

            Submitting for integration.

            Show
            timhunt Tim Hunt added a comment - Submitting for integration.
            Hide
            poltawski Dan Poltawski added a comment -

            Integrated, thanks for fixing it Tim.

            Show
            poltawski Dan Poltawski added a comment - Integrated, thanks for fixing it Tim.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            A brilliant future is awaiting us out there, better with your code. Let's look towards the future together, this is now closed.

            (and won't be revisiting it unless some regression is found)

            Thanks and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - A brilliant future is awaiting us out there, better with your code. Let's look towards the future together, this is now closed. (and won't be revisiting it unless some regression is found) Thanks and ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13