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

unit test failure when running core_cache\administration_helper_test in isolation.

XMLWordPrintable

      When running tests in isolation (Moodle 4.5, php 8.1), we are getting the following 2 errors:

       

      1) core_cache\administration_helper_test::test_get_add_store_form
      Error: Class "moodleform" not found
      /var/www/html/cache/classes/form/cachestore_addinstance_form.php:30
      /var/www/html/lib/classes/component.php:214
      /var/www/html/cache/stores/file/addinstanceform.php:23
      /var/www/html/cache/classes/local/administration_display_helper.php:188
      /var/www/html/cache/tests/administration_helper_test.php:153
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:76
       
      

       

      2) core_cache\administration_helper_test::test_get_edit_store_form
      Error: Class "cachestore_addinstance_form" not found
      /var/www/html/cache/classes/local/administration_display_helper.php:238
      /var/www/html/cache/tests/administration_helper_test.php:173
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:76
      

       

       

      Adding 

      require_once($CFG->dirroot . '/lib/formslib.php');

       at the top of the cache/classes/form/cachestore_addinstance_form.php file solves the issue for us.

        1. result.png
          92 kB
          Huong Nguyen

            danmarsden Dan Marsden
            Noemie Noemie Ariste
            Andrew Lyons Andrew Lyons
            Huong Nguyen Huong Nguyen
            Huong Nguyen Huong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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