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

Recycle bin test should avoid reliance on hardcoded course_modules counts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Backup
    • Testing Instructions:
      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)
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16