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

message_airnotifier manager_test::test_check_configuration_detail should not test default notification preferences

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77123-401
    • MDL-77123-master
    • Hide
      1. Install some plugins that provide messages:

        git clone git@github.com:turnitin/moodle-mod_turnitintooltwo.git mod/turnitintooltwo
        git clone git@github.com:bostelm/moodle-mod_scheduler.git mod/scheduler
        git clone git@github.com:marxjohnson/moodle-block_messageteacher.git blocks/messageteacher
        git clone git@github.com:catalyst/moodle-tool_trigger.git admin/tool/trigger
        git clone git@github.com:moodleou/moodle-report_customsql.git report/customsql
        

      2. Run airnotifier tests:

        vendor/bin/phpunit --testsuite=message_airnotifier_testsuite
        

      3. Verify all tests pass
      Show
      Install some plugins that provide messages: git clone git@github.com:turnitin/moodle-mod_turnitintooltwo.git mod/turnitintooltwo git clone git@github.com:bostelm/moodle-mod_scheduler.git mod/scheduler git clone git@github.com:marxjohnson/moodle-block_messageteacher.git blocks/messageteacher git clone git@github.com:catalyst/moodle-tool_trigger.git admin/tool/trigger git clone git@github.com:moodleou/moodle-report_customsql.git report/customsql Run airnotifier tests: vendor/bin/phpunit --testsuite=message_airnotifier_testsuite Verify all tests pass

      The test_check_configuration_default test uses message_airnotifier_manager to get a report of the state of the system, however it assumes the system is in a vanilla state.

      To see why this is a problem:

      1. Install some plugins that provide messages:

        git clone git@github.com:turnitin/moodle-mod_turnitintooltwo.git mod/turnitintooltwo
        git clone git@github.com:bostelm/moodle-mod_scheduler.git mod/scheduler
        git clone git@github.com:marxjohnson/moodle-block_messageteacher.git blocks/messageteacher
        git clone git@github.com:catalyst/moodle-tool_trigger.git admin/tool/trigger
        git clone git@github.com:moodleou/moodle-report_customsql.git report/customsql
        

      2. Run airnotifier tests:

        vendor/bin/phpunit --testsuite=message_airnotifier_testsuite
        

      In this situation it is expected to see a warning from the airnotifier manager (which is displayed at the page: SITENAME/message/output/airnotifier/checkconfiguration.php), but the test is hardcoded to expect everything is OK.

      It doesn't really make sense to test this at all. As the only way to do so is to compute the number of providers configured vs the total number of providers, and then compare that to what the manager returns. And at that point you have simply copied the logic from the manager into the test.

            cameron1729 cameron1729
            cameron1729 cameron1729
            Jake Dallimore Jake Dallimore
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

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