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

Consider getting rid of various fake message senders in core tests

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2
    • Fix Version/s: None
    • Component/s: Messages, Unit tests
    • Labels:
    • Affected Branches:
      MOODLE_32_STABLE

      Description

      This is a followup of MDL-57015, where David Monllaó 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

              Assignee:
              Unassigned
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: