Wednesday, January 7, 2015

Mac install phpunit in MAMP or Symfony2

1. in symfony find composer.json and add phpunit/phpunit which can be found in https://packagist.org/packages/phpunit/phpunit

{
    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    }
}

2. run command composer update
3. change the path by command line: PATH="~/.composer/vendor/bin:/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.19/bin:$PATH"

now we can type "phpunit --version" to test.


install it 
$ wget https://phar.phpunit.de/phpunit.phar

$ chmod +x phpunit.phar

$ mv phpunit.phar /usr/local/bin/phpunit