Getting Started with PHPUnit
Installation on Linux or MacOSX
Section titled “Installation on Linux or MacOSX”Global installation using the PHP Archive
Section titled “Global installation using the PHP Archive”wget https://phar.phpunit.de/phpunit.phar # download the archive filechmod +x phpunit.phar # make it executablesudo mv phpunit.phar /usr/local/bin/phpunit # move it to /usr/local/binphpunit --version # show installed version numberGlobal installation using Composer
Section titled “Global installation using Composer”# If you have composer installed system widecomposer global require phpunit/phpunit # set PHPUnit as a global dependencyphpunit --version # show installed version number
# If you have the .phar file of composerphp composer.phar global require phpunit/phpunit # set PHPUnit as a global dependencyphpunit --version # show installed version numberLocal installation using Composer
Section titled “Local installation using Composer”# If you have composer installed system widecomposer require phpunit/phpunit # set PHPUnit as a local dependency./vendor/bin/phpunit --version # show installed version number
# If you have the .phar file of composerphp composer.phar require phpunit/phpunit # set PHPUnit as a local dependency./vendor/bin/phpunit --version # show installed version number