Installing PHPUnit

Purpose:
To guide individuals through the PHPUnit Installation for Zurmo Development setup.

Audience:
Anyone who wants to equip his machine with Zurmo.

Setup

    • Follow this and get composer installed.
    • Read this if you don’t know about composer home dir
    • Add
      $COMPOSER_HOME/vendor/bin

      to your path

    • Go to your composer’s home dir
    • Create a new file called composer.json with following contents:
{
    "require-dev": {
        "phpunit/phpunit": "^4.2.0",
        "phpunit/php-invoker": "^1.1.0",
        "phpunit/dbunit": "^1.3.0",
        "phpunit/phpunit-selenium": "^1.4.0",
        "phpunit/phpunit-mock-objects": "^2.2.0",
        "phpunit/phpunit-story": "^1.0.0",
        "phpunit/phpunit-skeleton-generator": "^2.0.0",
        "phpunit/php-code-coverage": "~2.0"
    }
}
  • Run
    composer global update

Leave a Comment

  • Rose Hosting

    PHPUnit can also be downloaded with:
    sudo wget -O /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
    sudo chmod +x /usr/local/bin/phpunit

    usage:
    php phpunit

  • roderickm

    These instructions may be due for a refresh. After following these instructions, running phpunit emits the following warning:

    You have installed PHPUnit via PEAR. This installation method is no longer supported and http://pear.phpunit.de/ will be shut down no later than December, 31 2014.

    Please read http://phpunit.de/manual/current/en/installation.html and learn how to use PHPUnit from a PHAR or install it via Composer.