PHPUnit via Composer in Moodle 2.4

Starting in Moodle 2.4 the recommended way to install PHPUnit for Moodle testing is via Composer dependency manager.

Benefits compared to old-style PEAR installations

  • much easier installation
  • local installation in Moodle dirroot
  • safe and easy upgrades

Installation in *nix

$ cd /your/moodle/dirroot
$ curl -s | php
$ php composer.phar install

Test execution in *nix

$ cd /your/moodle/dirroot
$ vendor/bin/phpunit

See for more information about testing of Moodle code with PHPUnit.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>