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

phpunit test error Class "externallib_advanced_testcase" not found

XMLWordPrintable

      Running the full phpunit test set fails at Testing suite core_blog_testsuite.

      This seems to be a result of MDL-81520
      I tested with all four fixed branches from that issue and it only affects the 401 and 403 branches.

      Pretty sure it's just a missing
      require_once($CFG->dirroot . '/webservice/tests/helpers.php');

      To reproduce:
      run vendor/bin/phpunit blog/tests/external/external_test.php

      Expected:
      OK (52 tests, 262 assertions)

      Actual:
      PHP Fatal error: Uncaught Error: Class "externallib_advanced_testcase" not found in /var/www/html/blog/tests/external/external_test.php:40
      Stack trace:
      #0 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once()
      #1 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load('/var/www/html/b...')
      #2 /var/www/html/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php(43): PHPUnit\Util\FileLoader::checkAndLoad('/var/www/html/b...')
      #3 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(146): PHPUnit\Runner\StandardTestSuiteLoader->load('/var/www/html/b...')
      #4 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(112): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('/var/www/html/b...')
      #5 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(121): PHPUnit\Runner\BaseTestRunner->getTest('/var/www/html/b...', Array)
      #6 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(97): PHPUnit\TextUI\Command->run(Array, true)
      #7 /var/www/html/vendor/phpunit/phpunit/phpunit(98): PHPUnit\TextUI\Command::main()
      #8 /var/www/html/vendor/bin/phpunit(122): include('/var/www/html/v...')
      #9 {main}

            lameze Simey Lameze
            sashaanastasi1 SashaAnastasi
            Paul Holden Paul Holden
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 24 minutes
                24m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.