Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Q: Using the test database as the DB for the WPBrowser module #209
I have a tests database configured for the WPDB module in my acceptance.suite.yml. As part of an acceptance test, I call $I->havePostinDatabase which does insert the new post in the test database (if I look via phymyadmin before ending the test).
Next, I move to $I->amOnAdminPage('/') where I have a dashboard widget that displays the number of posts published today. When using $I->see , the value that pops up is the one in the "real" localhost suite, not the one corresponding to the test database. So, I guess that WPDB uses the tests db but WPBrowser uses the "real" one.
This may be the default behaviour (based on the discussion in #189 ) but if so, is there any way to configure codeception / WPBrowser to force the WP site to use the tests database during the test? Or is there a completely different way to do this?
From your configuration the
Db switch in wp-config.php
In any case: do not use a site with any data you care about for your tests.