From 70b110a5aa14e26414f9dab8046efec6d3408584 Mon Sep 17 00:00:00 2001 From: Bec Scott Date: Fri, 17 Apr 2020 02:55:25 +1000 Subject: [PATCH] Add PHP unit test instructions to CONTRIBUTING.md (https://github.com/woocommerce/woocommerce-admin/pull/4130) Co-authored-by: Rebecca Scott --- plugins/woocommerce-admin/CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/woocommerce-admin/CONTRIBUTING.md b/plugins/woocommerce-admin/CONTRIBUTING.md index 790a6bd3d3f..6f0ca759c12 100644 --- a/plugins/woocommerce-admin/CONTRIBUTING.md +++ b/plugins/woocommerce-admin/CONTRIBUTING.md @@ -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.") 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//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//woocommerce-admin` +3. `./vendor/bin/phpunit` to actually run the test suite + ## 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)):