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

Consider getting rid of various fake message senders in core tests

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.2
    • Messages, Unit tests
    • MOODLE_32_STABLE

      This is a followup of MDL-57015, where dmonllao raised the existence of send_fake_unread_popup_notification() function because message_send() does use transactions and that's clashing with phpunit reset (postgres and mssql) also using transactions.

      For this cases is when preventResetByRollback() was created because that makes the databases above to use the slower method for reseting, not using transactions.

      So, this is about:

      1) verify that by adding preventResetByRollback() the unit tests can be using message_send() without problem. It sounds to me we already have tests that way.

      2) replace all occurrences of the functions below by correct alternative (reset + configuration + message-send, or generator or whatever is needed to work using APIs instead of these helpers):

      • message_popup_test_helper::send_fake_unread_popup_notification()
      • message_popup_test_helper::send_fake_read_popup_notification()
      • core_message_externallib_testcase::send_message()
      • core_message_messagelib_testcase::send_fake_message()

      3) get rid of the helpers.

      Ciao

            Unassigned Unassigned
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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