roelmagdaleno / wp-phpunit-plugin-example

1 stars 0 forks source link

Integrate PHPUnit 9, PHPUnit Polyfills and Pest #1

Open roelmagdaleno opened 2 years ago

roelmagdaleno commented 2 years ago

In phpunit.xml.dist file, we have to set the testsuite like this:

<testsuite name="testing-phpunit">
   <directory suffix="Test.php">./tests/</directory>
</testsuite>
roelmagdaleno commented 2 years ago

Then, on each test, add this code at the beginning:

uses(WP_UnitTestCase::class);

The WP_UnitTestCase class will be loaded from tests/bootstrap.php.