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

Update composer to get it working with phpunit >= 7.5.15

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: Unit tests
    • Labels:
      None

      Description

      Right now we are using phpunit 7.5.14

      The 7.x branch of phpunit only supports (officially) php71, php72 and php73.
      The 8.x branch of phpunit only supports php72, php73 and php74.

      Moodle 3.8.x is expected to support php71, php72, php73 and php74.

      The 8.x phpunit branch cannot be used for php71 (the min php72 requirement is locked).
      The 7.5 phpunit branch can be used for php74, if some changes are applied to it.

      This 7.5 phpunit PR has been accepted, enabling our tests to run without problem (other than the problems that will be fixed in the 7.4 epic:

      https://github.com/sebastianbergmann/phpunit/pull/3765

      This issue is about to:

      1) Wait till a new phpunit 7.5.15 is released.
      2) composer update core to get the php 7.4 fix applied to our runs.
      3) test moodle with php74 normally.

      Related topics:

      A) Surely for Moodle 3.9 release, that will support php72, php73 and php74... we'll have to bump to phpunit 8.x (because it matches the php versions 100%). This is a recurring tasks to be performed yearly, for all the May releases.

      B) Trick: Until phpunit 7.5.15 is released anybody wanting to run unit tests agains php74 can apply for it by changing our composer.json this way (and then execute a composer update):

      diff --git a/composer.json b/composer.json
      index 5a86efa985..5f8231ba5b 100644
      --- a/composer.json
      +++ b/composer.json
      @@ -11,7 +11,7 @@
               }
           ],
           "require-dev": {
      -        "phpunit/phpunit": "7.5.*",
      +        "phpunit/phpunit": "7.5.x-dev",
               "phpunit/dbunit": "4.0.*",
               "moodlehq/behat-extension": "3.38.1",
               "mikey179/vfsstream": "^1.6",
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19