Add PHP unit test instructions to CONTRIBUTING.md (https://github.com/woocommerce/woocommerce-admin/pull/4130)

Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
Bec Scott 2020-04-17 02:55:25 +10:00 committed by GitHub
parent ae526f7e1e
commit 70b110a5aa
1 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,22 @@ After you've made your updates, you're ready to commit:
3. Create your commit. Write a descriptive, but short first line (e.g. "Reports: Reticulate the splines"), and add more details below. If your commit addresses a github issue, reference it by number here (e.g. "This commit fixes issue #123 by reticulating all the splines.") 3. Create your commit. Write a descriptive, but short first line (e.g. "Reports: Reticulate the splines"), and add more details below. If your commit addresses a github issue, reference it by number here (e.g. "This commit fixes issue #123 by reticulating all the splines.")
4. Push the branch up to your local fork, then create a PR via the GitHub web interface. 4. Push the branch up to your local fork, then create a PR via the GitHub web interface.
## PHP Unit tests
### Setting up PHP unit tests using VVV
1. SSH into the Vagrant box:
1. `cd` down to the Vagrant root (where `www` lives)
2. `vagrant ssh`
2. `cd /srv/www/<name of wp install>/woocommerce-admin`
3. `bin/install-wp-tests.sh wc-admin-tests root root`
### Running tests
1. SSH into the Vagrant box (`vagrant ssh`)
2. `cd /srv/www/<name of wp install>/woocommerce-admin`
3. `./vendor/bin/phpunit` to actually run the test suite
## Helper Scripts ## Helper Scripts
There are a number of helper scripts exposed via our `package.json` (below list is not exhaustive, you can view the [`package.json` file directly to see all](https://github.com/woocommerce/woocommerce-admin/blob/master/package.json)): There are a number of helper scripts exposed via our `package.json` (below list is not exhaustive, you can view the [`package.json` file directly to see all](https://github.com/woocommerce/woocommerce-admin/blob/master/package.json)):