diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 91f4df85..309eb1b5 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -83,16 +83,51 @@ Install [Composer](https://getcomposer.org) following your devices OS [installat ## Install PHPUnit -### Via Composer +### Via PHP Archive (PHAR) + +The easiest way to use PHPUnit for Exercism exercises is downloading a distribution that is packaged as a PHP Archive (PHAR), which is also the recommended way to use PHPUnit. +Store the PHAR where you stored the `exercism` CLI to run PHPUnit from wherever you are. -PHPUnit version 10 can be installed globally via [Composer](https://getcomposer.org), using the following command: +You can download a release of PHPUnit packages as a PHP archive: ```shell -composer global require phpunit/phpunit ^10.5 +wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar +``` + +Then make the downloaded file executable: + +```shell +chmod +x phpunit.phar ``` -Please make sure you install version 10.5 or later. +And move it to the same location as you moved the `exercism` CLI, naming the command `phpunit`: + +```shell +mv phpunit.phar ~/bin/phpunit +``` + +Now you can run `phpunit` from wherever you are, as shown in the [PHP track testing docs](https://exercism.org/docs/tracks/php/tests): + +```shell +phpunit --version +``` -### Manual installation +The output should look like this: + +``` +PHPUnit 10.5.45 by Sebastian Bergmann and contributors. + +``` + + +You can also follow the official [Installing PHPUnit instructions](https://docs.phpunit.de/en/10.5/installation.html#installing-phpunit) to install PHPUnit. + +### Via Composer + +PHPUnit version 10 can also be installed globally via [Composer](https://getcomposer.org), using the following command: + +```shell +composer global require phpunit/phpunit ^10.5 +``` -If you are not using Composer package manager, follow the official [Installing PHPUnit instructions](https://docs.phpunit.de/en/10.5/installation.html#installing-phpunit). +Please make sure you install version 10.5 or later. \ No newline at end of file