PHPUnit on VVV

If you are developing something for WooCommerce Admin, you will probably want to use PHPUnit. If you are using Vagrant, you will already have everything ready to get started.

These are some steps to run PHPUnit on a VVV instance.

1 – SSH into a running Vagrant machine (more info) with this command:

$ vagrant ssh [instance id]

2 – Go to the plugin’s folder with this command:

$ cd /srv/www/wordpress-one/public_html/wp-content/plugins/woocommerce-admin

3 – Update composer:

$ composer update

4 – Execute tests:

$ vendor/bin/phpunit

4.1 – Install tests if it’s necessary, running:

$ bin/install-wp-tests.sh 'wordpress-one-test' 'wp' 'wp' 'localhost' '5.3.2' 'true' //dbname=wordpress-one-test user=wp password=wp host=localhost wp-version=5.3.2 skip-database-creation=true

And try step 4 again.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *