headers
entry of the WPBrowser
or WPWebDriver
module in the suite configuration file.acceptance
suite configuration file setting two custom headers, X_WPBROWSER_REQUEST
and X_TEST_REQUEST
, on each request sent by the WPWebDriver
module:The two headers are sent on each HTTP request type, not just onGET
type requests.
WPWebDriver
module contains those two headers, it's time for WordPress to check those and change the database to use accordingly.DB_NAME
constant that is, in turn, set in the wp-config.php
file.
Different setups could involve more complex configurations for the wp-config.php
file but, for the sake of simplicity, I assume the default WordPress wp-config.php
file structure.
In the example below, the default database name is wordpress
, while the name of the test database is tests
.wp-config.php
file.default_db_name
is the name of the database your test WordPress installation normally uses.