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

Specify phpunit dependency as require-dev instead of require

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.1, 2.5
    • Fix Version/s: 2.4.1
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      1/ delete dirroot/vendor/
      2/ delete dirrott/composer.lock
      3/ try php composer.phar install --dev
      4/ verify phpunit is installed into vendor dir
      5/ verify --dev was added to the info in the phpunit admin tool

      Show
      1/ delete dirroot/vendor/ 2/ delete dirrott/composer.lock 3/ try php composer.phar install --dev 4/ verify phpunit is installed into vendor dir 5/ verify --dev was added to the info in the phpunit admin tool
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w49_MDL-36936_m25_composerdev

      Description

      In 2.4 phpunit is specified as a 'require' package in the composer installer (composer.json), the 'require-dev' attribute, which is more appropriate for dev/test purposes can be used instead of it. Would be useful if in future Moodle intends to use composer to manage other libraries dependencies (used by Moodle core). The only difference using this attribute instead of 'require' is that composer has to be executed with --dev option (http://getcomposer.org/doc/04-schema.md#require-dev)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              skodak Petr Skoda added a comment -

              Thanks a lot.

              Show
              skodak Petr Skoda added a comment - Thanks a lot.
              Hide
              skodak Petr Skoda added a comment -

              Thanks for the proposal, I have already updated the docs because the --dev is also backwards compatible with 2.4.0

              Show
              skodak Petr Skoda added a comment - Thanks for the proposal, I have already updated the docs because the --dev is also backwards compatible with 2.4.0
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Thanks Petr, nice catch David, has been integrated now.

              Show
              samhemelryk Sam Hemelryk added a comment - Thanks Petr, nice catch David, has been integrated now.
              Hide
              nebgor Aparup Banerjee added a comment -

              (just noting Petr is backporting this via MDL-36817 too)

              Show
              nebgor Aparup Banerjee added a comment - (just noting Petr is backporting this via MDL-36817 too)
              Hide
              nebgor Aparup Banerjee added a comment -

              (from 10mins head scratching) - maybe useful to note.. if you had a setup that had the required dependencies and then ran composer install (without --dev) , then it uninstalls the now dev dependencies.

              Show
              nebgor Aparup Banerjee added a comment - (from 10mins head scratching) - maybe useful to note.. if you had a setup that had the required dependencies and then ran composer install (without --dev) , then it uninstalls the now dev dependencies.
              Hide
              dmonllao David Monllaó added a comment -

              It passes, it installs phpunit and all it's dependencies into vendor/ and writes the versions in composer.lock

              Show
              dmonllao David Monllaó added a comment - It passes, it installs phpunit and all it's dependencies into vendor/ and writes the versions in composer.lock
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Many thanks for your effort, the whole Moodle Community will be enjoying your great solutions starting now!

              Closing, ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Many thanks for your effort, the whole Moodle Community will be enjoying your great solutions starting now! Closing, ciao

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Jan/13