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

Consider getting rid of various fake message senders in core tests

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.2
    • None
    • Messages, Unit tests
    • MOODLE_32_STABLE

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: