~/Repos/VVVdirectory, that we are working on the
my-pluginproject and that the plugin is being developed in the default (
wordpress-one) WordPress installation provided by the box. If your VVV installation lies elsewhere, replace the
~/Repos/VVVwith the actual directory in each command.
http://one.wordpress.test/is the first default site address.
http://two.wordpress.test/is the second default site address.
http://vvv.test/is VVV dashboard address.
~/Repos/VVVfolder (assuming that is the folder where VVV was installed) is this:
vagrantuser. To exit from the SSH session inside the box, just type
http://one.wordpress.testinstallation plugins directory, in the
By default, VVV administrator user name is
adminand password is
composer.jsonfile generated by the above answers:
lucatume/wp-browseras a development dependency:
Since wp-browser requires Codeception, there is no need to require Codeception explicitly as a development dependency.
http://one.wordpress.testin the case of the VVV default installation).
wp-browserwill use the databases it works on in a destructive way: between tests the data will be lost.
root. The first command creates the
testsdatabase, if it does not exist; the second command grants the
wpuser all privileges on it.
In VVV the root database user name is
rootand the password is
testsdatabase should be present in the list.
wp-browserusing its interactive mode:
My Plugin Test
Backgroundany scenario will share. In the case of a plugin the minimal, starting environment is the following:
http://one.wordpress.test/wp-admin, or use wp-cli and save precious time.
The following command will empty the site, backup any content you care about first!
vagrant sshto log in):
wp-config.phpfile, to handle the requests made by the tests.
testsbut, looking at the contents of the
DB_NAMEconstant is set to
~/Repos/VVV/www/wordpress-one/public_html/wp-config.phpand replace the line defining the
DB_NAMEconstant like this:
tests/functional.suite.ymlfiles, respectively the
functionalsuite configuration files, you will see these entries in the
vendor/bin/codeceptto see a list of the available commands.