Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update php/docs/intallation.md #882

Merged
merged 6 commits into from
Mar 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.