An ongoing playground to showcase examples and "gotchas" of WordPress integration tests.
Clone the plugin in your local WordPress installation plugins folder:
cd /var/www/wp/wp-content/plugins
git clone https://github.com/lucatume/acme.git
From the plugin root install Composer dependencies:
cd acme
composer install
Configure the tests/integration.suite.yml
and tests/muintegration.suite.yml
suites updating the two configuration files with your local setup information and finally run the tests:
codecept run integration && codecept run muintegration
See why running single site and multisite tests in the same run is not a good idea here.
The plugin offers no functions and is meant to be an ongoing list of examples about WordPress integration testing.
While you can activate it on your website it will not do anything.
I will update this plugin code with more examples as I write more and more about WordPress integration testing in my blog; here are some good starters:
- the Core PhpUnit based testing suite
- Codeception, the testing framework on which
wp-browser
builds - wp-cli package to scaffold wp-browser based plugin tests
- some basic principles of WordPress integration testing
- running integration tests in multisite mode with wp-browser
- multisite integration testing basic principles
- the
post
factory - caveats about running single and multisite mode integration tests