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

tool_dataprivacy unit tests have data created in a provider

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.5.1, 3.6
    • Fix Version/s: 3.5.2
    • Component/s: Privacy, Unit tests
    • Labels:

      Description

      admin/tool/dataprivacy/tests/api_test.php::get_data_requests_provider is creating data in a dataProvider. This is fundamentally wrong and will break things.

      This is seen when calling any phpunit test which does not reset state as a database modification.

      Data providers are run before phpunit starts at all. They must not, in fact can not create data because they are called prior to setUp and any test.

      They must not be used to create data. They are intended to provide a set of data and expected result, not as a test setUp.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpataleta Jun Pataleta
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Mihail Geshoski
              Integrator:
              Andrew Nicols
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/18