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

Coursecat unit tests missing include.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Course
    • Labels:

      Description

      If you run just the coursecat unit tests you get fatal errors as course/lib.php hasn't been included.

      vendor/bin/phpunit lib/tests/coursecatlib_test.php
      Moodle 2.5beta+ (Build: 20130502), pgsql, 081bfdc5fff23b2c1eedcbfb35d49e1a7006d405
      PHPUnit 3.7.19 by Sebastian Bergmann.

      Configuration read from /var/www/integration/phpunit.xml

      ...PHP Fatal error: Call to undefined function get_category_or_system_context() in /var/www/integration/lib/coursecatlib.php on line 1491
      PHP Stack trace:
      PHP 1.

      Unknown macro: {main}

      () /var/www/integration/vendor/phpunit/phpunit/composer/bin/phpunit:0
      PHP 2. PHPUnit_TextUI_Command::main() /var/www/integration/vendor/phpunit/phpunit/composer/bin/phpunit:63
      PHP 3. PHPUnit_TextUI_Command->run() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
      PHP 4. PHPUnit_TextUI_TestRunner->doRun() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
      PHP 5. PHPUnit_Framework_TestSuite->run() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:349
      PHP 6. PHPUnit_Framework_TestSuite->runTest() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:745
      PHP 7. PHPUnit_Framework_TestCase->run() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:775
      PHP 8. PHPUnit_Framework_TestResult->run() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:776
      PHP 9. advanced_testcase->runBare() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
      PHP 10. PHPUnit_Framework_TestCase->runBare() /var/www/integration/lib/phpunit/classes/advanced_testcase.php:76
      PHP 11. PHPUnit_Framework_TestCase->runTest() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:831
      PHP 12. ReflectionMethod->invokeArgs() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:976
      PHP 13. coursecatlib_testcase->test_hierarchy() /var/www/integration/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:976
      PHP 14. coursecat->can_change_parent() /var/www/integration/lib/tests/coursecatlib_test.php:218

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                samhemelryk Sam Hemelryk
                Reporter:
                samhemelryk Sam Hemelryk
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13