dingo-d / wp-pest

A package that will add WordPress integration test suite with Pest
MIT License
119 stars 5 forks source link

Use correct test base class for integration tests #23

Closed dingo-d closed 1 year ago

dingo-d commented 1 year ago

Description

Previously, both unit and integration tests used the same base test class. While this worked, integration tests weren't using the polyfilled WP_UnitTestCase case from the wp-test-utils package.

This, in turn, meant that the tests weren't properly cleaned up and that some usefull features, like WordPress test factories couldn't be used easily in the integration tests.

This commit fixes this issue.

The caveat is that, because of how Pest works, we cannot just define the uses statement in the Pest.php file, because the WordPress unit test class becomes available after the bootstrap process. For more details see the issue https://github.com/pestphp/pest/issues/623.

Checklist: