Skip to content

1.0.0

Compare
Choose a tag to compare
@jrfnl jrfnl released this 27 Sep 05:57
· 101 commits to develop since this release
21df3a0

WordPress 5.9 contains significant changes to the WordPress native test suite, which impacts integration tests.
Please see the dev-note about these changes on Make WordPress for full details.

This release makes WP Test Utils compatible with these changes, but can't fully mitigate them, though if you were using WP Test Utils before, you're already half prepared for these changes.

For users of WP Test Utils, a search for declarations of and calls to the setUpBeforeClass(), setUp(), tearDown() and tearDownAfterClass() methods and replacing these with their snake_case equivalents set_up_before_class(), set_up() tear_down() and tear_down_after_class() is all that is required to make your test suite compatible again with the latest versions of WordPress.

You also may want to do some tweaking to the CI scripts used to run the tests to allow for using the optimal PHPUnit version to run the tests.
See the Make Core dev-note for guidance.

Added

  • Integration tests bootstrap utilities: the Yoast\WPTestUtils\WPIntegration\get_path_to_wp_test_dir() function will now also search for the WP Core test framework files in the system temp directory as per the typical setup created by the WP-CLI scaffold command. PR #16
    This means that if the install-wp-tests.sh script is used without adjustments, the path to the WP native test bootstrap should be findable by WP Test Utils without needing to set the WP_TESTS_DIR environment variable.
    If you previously adjusted your test bootstrap to set this environment variable, you should now be able to remove it.

Changed

  • Integration tests: both the TestCase as well as the bootstrap utilities have been adjusted to be cross-version compatible with the WP Core test framework as it is per WP 5.9, while still maintaining compatibility with older WP versions as well, including WP < 5.2. PR #20
  • Yoast\WPTestUtils\BrainMonkey\YoastTestCase: the is_multisite() stub will now respect a potentially set WP_TESTS_MULTISITE PHP constant. PR #22
  • The PHPUnit Polyfills dependency has been updated to require version ^1.0.1 (was ^1.0.0).
  • README: the documentation has been partially rewritten to make it clearer what problems WP Test Utils solves.
  • General housekeeping.

Fixes

  • The PHPUnit Polyfills dependency introduced three new polyfills in the 1.0.0 version. These are now supported in all test cases. #17

Thanks Pierre Gordon and Pascal Birchler for making feature suggestions for this version.