Uploaded image for project: '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
    • Status: Closed
    • Priority: 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:

      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.

        Gliffy Diagrams

          Activity

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

          Submitting this for integration.

          Show
          timhunt Tim Hunt added a comment - Submitting this for integration.
          Hide
          skodak Petr Skoda added a comment -

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

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

          Integrated, thanks

          Show
          skodak Petr Skoda added a comment - Integrated, thanks
          Hide
          nebgor Aparup Banerjee added a comment -

          ok, all those unit tests have run fine for me

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

          Sent upstream and closing, many thanks!

          Show
          stronk7 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:
                Fix Release Date:
                10/Oct/11