PATH
, you should be able to run composer --version
at the terminal and see the version correctly.C:\wamp64\www\wp
directory. If your installation lies elsewhere, replace the C:\wamp64\www\wp
path with the actual directory in each command.http://localhost/phpmyadmin/index.php
page and create two new databases:wordpress
is the database you will use for WordPresstests
is the database you will use for the testsThe default database user isroot
, the default password is empty.
C:\wamp64\www\wp
and head over to http://localhost/wp
to install WordPress.
The database credentials for the installation are:wordpress
root
localhost
admin
as administrator user name and password
as password for the administrator user.http://localhost/wp
and that you can correctly access the administration area at http://localhost/wp/wp-admin
.my-plugin
plugin.C:\wamp64\www\wp\wp-content\plugins\my-plugin\my-plugin.php
file:http://localhost/wp/wp-admin/plugins.php
.composer.json
file generated by the above answers:lucatume/wp-browser
as a development dependency:vendor/bin
folder.
To check Codeception is correctly installed run this command:Since wp-browser requires Codeception, there is no need to require Codeception explicitly as a development dependency.
http://localhost/wp
.http://localhost/phpmyadmin/
, under the "Export" tab:wp-browser
using its interactive mode:wp-browser
.y
y
acceptance
functional
wpunit
.env.testing
C:/wamp64/www/wp
/wp-admin
tests
localhost
root
wp_
tests
localhost
root
wp_
http://localhost/wp
[email protected]
My Plugin Test
admin
password
plugin
my-plugin/my-plugin.php
no
Background
any scenario will share. In the case of a plugin the minimal, starting environment is the following:my-plugin
.http://localhost/wp/wp-admin
.The following command will empty the site, backup any content you care about first!
http://localhost/phpmyadmin/
and move the file to the C:\wamp64\www\wp\wp-content\plugins\my-plugin\tests\_data\dump.sql
directory.wp-config.php
file, to handle the requests made by the tests.acceptance
and functional
tests as tests
but, looking at the contents of the C:\wamp64\www\wp\wp-config.php
file, the DB_NAME
constant is set to wordpress
.wordpress
database.tests
database.C:\wamp64\www\wp\wp-config.php
and replace the line defining the DB_NAME
constant like this:tests/acceptance.suite.yml
and tests/functional.suite.yml
files, respectively the acceptance
and functional
suite configuration files, you will see these entries in the WPBrowser
module configuration:$_SERVER['HTTP_X_TEST_REQUEST']
and $_SERVER['X_WPBROWSER_REQUEST']
variables.vendor/bin/codecept.bat
to see a list of the available commands.