Fix README in the tests directory
The instructions to run the unit tests in PHP 8 were missing a couple of required commands.
This commit is contained in:
parent
963eef02fa
commit
f7137a44e6
|
@ -96,7 +96,7 @@ To workaround this, the testing strategy used by WooCommerce is as follows:
|
||||||
* We normally use PHPUnit 6.5.14
|
* We normally use PHPUnit 6.5.14
|
||||||
* For PHP 8 we use [a custom fork of PHPUnit 7.5.20 with support for PHP 8](https://github.com/woocommerce/phpunit/pull/1). WooCommerce's GitHub Actions CI workflow is configured to use this fork instead of the old version 6 when running in PHP 8.
|
* For PHP 8 we use [a custom fork of PHPUnit 7.5.20 with support for PHP 8](https://github.com/woocommerce/phpunit/pull/1). WooCommerce's GitHub Actions CI workflow is configured to use this fork instead of the old version 6 when running in PHP 8.
|
||||||
|
|
||||||
If you want to run the tests locally under PHP 8 you'll need to temporarily modify `composer.json` to use the custom PHPUnit fork in the same way that the GitHub Actions CI workflow file does. These are the commands that you'll need (run them after a regular `composer install`):
|
If you want to run the tests locally under PHP 8 you'll need to temporarily modify `composer.json` to use the custom PHPUnit fork in the same way that the GitHub Actions CI workflow file does. These are the commands that you'll need (run them after a regular `composer install` from within the `plugins/woocommerce` directory):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip
|
curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip
|
||||||
|
@ -104,6 +104,8 @@ unzip -d /tmp/phpunit-7.5-fork /tmp/phpunit-7.5-fork.zip
|
||||||
composer bin phpunit config --unset platform
|
composer bin phpunit config --unset platform
|
||||||
composer bin phpunit config repositories.0 '{"type": "path", "url": "/tmp/phpunit-7.5-fork/phpunit-add-compatibility-with-php8-to-phpunit-7", "options": {"symlink": false}}'
|
composer bin phpunit config repositories.0 '{"type": "path", "url": "/tmp/phpunit-7.5-fork/phpunit-add-compatibility-with-php8-to-phpunit-7", "options": {"symlink": false}}'
|
||||||
composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
|
composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
|
||||||
|
rm -rf ./vendor/phpunit/
|
||||||
|
composer dump-autoload
|
||||||
```
|
```
|
||||||
|
|
||||||
Just remember that you can't include the modified `composer.json` in any commit!
|
Just remember that you can't include the modified `composer.json` in any commit!
|
||||||
|
|
Loading…
Reference in New Issue