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

Recycle bin test should avoid reliance on hardcoded course_modules counts

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • Hide
      With the patch reverted:
      1. Run the following unit tests (pass expected)

        vendor/bin/phpunit tool_recyclebin_course_bin_tests admin/tool/recyclebin/tests/course_bin_test.php
        

      2. Install mod_oublog
      3. Run the tests again (fail expected)
      With the patch re-applied
      1. Run the unit tests again (pass expected)
      Show
      With the patch reverted: Run the following unit tests (pass expected) vendor/bin/phpunit tool_recyclebin_course_bin_tests admin/tool/recyclebin/tests/course_bin_test.php Install mod_oublog Run the tests again (fail expected) With the patch re-applied Run the unit tests again (pass expected)

      One of the unit tests for tool_recyclebin makes an assumption that a fresh install of Moodle has no course modules, which is true for vanilla moodle.

      However there are some third party plugins (mod_oublog and mod_respondusws are the ones I've run into) that have a course module added to the frontpage course on install.

      So this change alters the test from comparing the count of modules in the test course with a hardcoded value to first getting the existing count of values before performing the actions that affect the count and then using that value to compare with.

            aolley Adam Olley
            aolley Adam Olley
            Mark Nelson Mark Nelson
            Andrew Lyons Andrew Lyons
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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