Moodle
  1. Moodle
  2. MDL-37694

Move reportlib_test.php to mod/quiz/tests/

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      47404

      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).

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          Tim Hunt added a comment -

          Submitting for integration.

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

          Integrated, thanks for fixing it Tim.

          Show
          Dan Poltawski added a comment - Integrated, thanks for fixing it Tim.
          Hide
          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
          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: