Roots and WP Packages are independent open source projects, supported only by developers like you. We’ve been improving the WordPress developer experience since 2011, and your support keeps it independent.
Testing Bedrock with Pest
Bedrock includes a minimal testing setup based on Pest (powered by PHPUnit).
Running tests
Run the test suite from your Bedrock root:
$ composer test
Default test structure
Bedrock ships with these testing files:
phpunit.xml.dist- PHPUnit configuration used by Pesttests/Pest.php- Pest bootstrap and shared test configurationtests/Feature/ExampleTest.php- Example test
Writing tests
Add tests anywhere under tests/:
<?php
test('home URL is configured', function () {
expect(env('WP_HOME'))->not->toBeEmpty();
});
Then run:
$ composer test
Scope of the default setup
The default setup is intentionally minimal and framework-agnostic:
- It gives you a ready-to-run PHP testing baseline
- It does not include WordPress core integration test bootstrap or database test provisioning
If you need deeper WordPress integration testing, you can extend this baseline with your preferred tooling.
Last updated