Setup for WordPress testing
Testing framework agnostic
Warning
Setup tests
use PHPUnit\Framework\TestCase;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use Brain\Monkey;
class MyTestCase extends TestCase {
// Adds Mockery expectations to the PHPUnit assertions count.
use MockeryPHPUnitIntegration;
protected function setUp() {
parent::setUp();
Monkey\setUp();
}
protected function tearDown() {
Monkey\tearDown();
parent::tearDown();
}
}Last updated