From 12769d73dba210f881baed540e6010eb38fa4493 Mon Sep 17 00:00:00 2001 From: Obinna Emmanuel Obi-Akwari Date: Wed, 5 Mar 2025 22:31:54 +0100 Subject: [PATCH 1/6] update php/docs/intallation.md --- docs/INSTALLATION.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 91f4df85..df993bca 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -83,16 +83,31 @@ 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. + +### Manual installation -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 PHAR executable (it is a common practice) + +```shell +chmod +x phpunit.phar ``` +Now you can run the PHAR. -Please make sure you install version 10.5 or later. +You can also follow the official [Installing PHPUnit instructions](https://docs.phpunit.de/en/10.5/installation.html#installing-phpunit) to Install PHPUnit via a PHP Archive (PHAR) -### Manual installation +### Via Composer + +PHPUnit version 10 can also be installed globally via [Composer](https://getcomposer.org), using the following command: -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). +```shell +composer global require phpunit/phpunit ^10.5 +``` +Please make sure you install version 10.5 or later. \ No newline at end of file From c27d525b7a77cc5a5ed6d5d4cfcc2aa5e21c2bf9 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:00:44 +0100 Subject: [PATCH 2/6] Update docs/INSTALLATION.md Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- docs/INSTALLATION.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index df993bca..972432f9 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -86,8 +86,7 @@ Install [Composer](https://getcomposer.org) following your devices OS [installat ### 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. - -### Manual installation +Store the PHAR where you stored the `exercism` CLI to run PHPUnit from wherever you are. You can download a release of PHPUnit packages as a PHP archive: From 51828fcb990d22d5f5cfedf647d890ff53ffd307 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:01:09 +0100 Subject: [PATCH 3/6] Update docs/INSTALLATION.md Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- docs/INSTALLATION.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 972432f9..eb247b20 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -93,7 +93,8 @@ You can download a release of PHPUnit packages as a PHP archive: ```shell wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar ``` -Then make the PHAR executable (it is a common practice) + +Then make the downloaded file executable: ```shell chmod +x phpunit.phar From 94c5c850e39f4112f9aa9cb2808281df4f6c8550 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:01:21 +0100 Subject: [PATCH 4/6] Update docs/INSTALLATION.md Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- docs/INSTALLATION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index eb247b20..935696ee 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -110,4 +110,5 @@ PHPUnit version 10 can also be installed globally via [Composer](https://getcomp ```shell composer global require phpunit/phpunit ^10.5 ``` + Please make sure you install version 10.5 or later. \ No newline at end of file From 20b6c4887b2f066ce1e226f655e96d0d395c3138 Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:01:57 +0100 Subject: [PATCH 5/6] Update docs/INSTALLATION.md Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- docs/INSTALLATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 935696ee..f680d633 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -101,7 +101,7 @@ chmod +x phpunit.phar ``` Now you can run the PHAR. -You can also follow the official [Installing PHPUnit instructions](https://docs.phpunit.de/en/10.5/installation.html#installing-phpunit) to Install PHPUnit via a PHP Archive (PHAR) +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 From 87ed6a4348b94d5033abe55051475d975a3f272a Mon Sep 17 00:00:00 2001 From: Obinna Obi-Akwari <111562983+A-O-Emmanuel@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:02:09 +0100 Subject: [PATCH 6/6] Update docs/INSTALLATION.md Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- docs/INSTALLATION.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index f680d633..309eb1b5 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -99,7 +99,26 @@ Then make the downloaded file executable: ```shell chmod +x phpunit.phar ``` -Now you can run the PHAR. + +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 +``` + +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.