Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-37779 unit test fixing META
  3. MDL-38364

admin/tool/phpunit/cli/init.php fails with latest PHPUnit

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4.1, 2.5
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Unit tests
    • Labels:
      None
    • Testing Instructions:
      Hide

      1/ upgrade composer in 24 stable, execute tests (this tests latest phpunit version)
      2/ upgrade composer in master, execute tests (this tests latest phpunit version)

      3/ On a system without phpunit installed by pear, install and run unit tests with composer

      Show
      1/ upgrade composer in 24 stable, execute tests (this tests latest phpunit version) 2/ upgrade composer in master, execute tests (this tests latest phpunit version) 3/ On a system without phpunit installed by pear, install and run unit tests with composer
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w12_MDL-38364_m25_phpunitloading

      Description

      The admin/tool/phpunit/cli/init.php script errors out with the latest PHPUnit, as PHPUnit does not expect to be have it's autoload.php required by anything but vendor/bin/phpunit in a composer installation. As far as I can tell, the constant PHPUNIT_COMPOSER_INSTALL should be defined before requiring PHPUnit/Autoload.php if the user is in fact running a composer install. The bin/phpunit script does that here

      I don't know what the patch submission process is yet, but defining that constant in [this block|
      https://github.com/moodle/moodle/blob/master/admin/tool/phpunit/cli/util.php#L51] should do it.

      See also: https://github.com/sebastianbergmann/phpunit/issues/848

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              stephen.sugden Stephen Sugden
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/13