Moodle
  1. Moodle
  2. MDL-28620

When running all simple tests from the command line the admin/generator.php script is called and run

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      Run each of these scripts through the unit tests report page and make sure each completes successfully with and without the admin/generator.php script included.

      I have done this and it makes no difference, I therefore conclude that the include is not needed and I can remove it without harm.

      Show
      Run each of these scripts through the unit tests report page and make sure each completes successfully with and without the admin/generator.php script included. I have done this and it makes no difference, I therefore conclude that the include is not needed and I can remove it without harm.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
    • Rank:
      18395

      Description

      I have a little script that runs all of the simple tests in moodle from the command line.

      There is an issue in a few of the simple tests where admin/generator.php is included (but not used). When admin/generator.php is included and the simple test is run from the command line the admin/generator.php script takes control and asks the user for input, then die()'s because it wasn't passed any params or args.

      I have fixed this by removing the include of admin/generator.php from the following simple tests

      lib/simpletest/portfolio_testclass.php
      lib/simpletest/testrepositorylib.php
      mod/assignment/simpletest/test_assignment_portfolio_callers.php
      mod/chat/simpletest/test_chat_portfolio_callers.php
      mod/data/simpletest/test_data_portfolio_callers.php
      mod/forum/simpletest/test_forum_portfolio_callers.php
      mod/glossary/simpletest/test_glossary_portfolio_callers.php
      portfolio/boxnet/simpletest/testportfoliopluginboxnet.php

      To test that this fix hasn't broken anything I removed the include from the simple tests and made sure that the same number of tests where run and all of tests still passed.

        Activity

        Hide
        Tim Hunt added a comment -

        This change gets a +1 from me. I am tempted to submit it for integration myself, but I think it would be better if someone from Moodle HQ did the peer review.

        Show
        Tim Hunt added a comment - This change gets a +1 from me. I am tempted to submit it for integration myself, but I think it would be better if someone from Moodle HQ did the peer review.
        Hide
        Tim Hunt added a comment -

        Submitting this for integration.

        Show
        Tim Hunt added a comment - Submitting this for integration.
        Hide
        Petr Škoda added a comment -

        I agree that the generator is not a library and must not be included.

        Show
        Petr Škoda added a comment - I agree that the generator is not a library and must not be included.
        Hide
        Petr Škoda added a comment -

        Integrated, thanks

        Show
        Petr Škoda added a comment - Integrated, thanks
        Hide
        Aparup Banerjee added a comment -

        ok, all those unit tests have run fine for me

        Show
        Aparup Banerjee added a comment - ok, all those unit tests have run fine for me
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Sent upstream and closing, many thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Sent upstream and closing, many thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: