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

Allow rerun command to work with namespaced tests

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.3, 3.5, 3.6
    • 3.4.4, 3.5.1
    • Unit tests
    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • Hide

      To verify both under linux and windows, for 34, 35 and master:

      1. Copy the attached file - mdl_62577_test.php - into mod/quiz/tests
      2. Run vendor/bin/phpunit -c mod/quiz --filter=mdl (will fail)
      3. Confirm that you get this rerun command: vendor/bin/phpunit -c mod/quiz "tests\mod_quiz\mdl_62577_testcase" mod/quiz/tests/mdl_62577_test.php
      4. Copy and paste this into the console and confirm that it reruns the unit test as expected (which still fails)
      Show
      To verify both under linux and windows, for 34, 35 and master: Copy the attached file - mdl_62577_test.php - into mod/quiz/tests Run vendor/bin/phpunit -c mod/quiz --filter=mdl (will fail) Confirm that you get this rerun command: vendor/bin/phpunit -c mod/quiz "tests\mod_quiz\mdl_62577_testcase" mod/quiz/tests/mdl_62577_test.php Copy and paste this into the console and confirm that it reruns the unit test as expected (which still fails)

    Description

      When a unit test fails, we get a message like the following:

      To re-run:
      vendor/bin/phpunit repository_flickr_privacy_testcase repository/flickr/tests/privacy_test.php

      where the command can be copied and pasted into the command line and run.

      If the testcase is namespaced, this doesn't work as the backslashes have to be manually escaped:

      To re-run:
      vendor/bin/phpunit \repository_flickr\privacy_testcase repository/flickr/tests/privacy_test.php

      It would be good if the class name were quoted to allow the command to work as-is.

      (I'm not sure how much of this is valid on Windows, but it's certainly the case on Linux.)

      Attachments

        Issue Links

          Activity

            People

              maherne Michael Aherne
              maherne Michael Aherne
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jul/18