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

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.7, 2.4.4
    • 2.3.6, 2.4.1, 2.5
    • Unit tests
    • None
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • w12_MDL-38364_m25_phpunitloading
    • 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

      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

            skodak Petr Skoda
            stephen.sugden Stephen Sugden
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.