PHPUnit via Composer in Moodle 2.4

Posted on by skodak

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 https://getcomposer.org/installer | php
$ php composer.phar install

Test execution in *nix

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

See docs.moodle.org/dev/PHPUnit for more information about testing of Moodle code with PHPUnit.

This entry was posted in Moodle and tagged Composer, PHPUnit by skodak. Bookmark the permalink.

Leave a Reply Cancel reply

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

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