Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 1.0.0 #25

Merged
merged 28 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
594d3a6
GH Actions: set error reporting to E_ALL
jrfnl Jun 22, 2021
7212360
Merge pull request #10 from Yoast/feature/ghactions-turn-on-error-rep…
jrfnl Jun 22, 2021
2c149f0
Composer: upgrade the PHPUnit Polyfills
jrfnl Aug 10, 2021
b47ec95
Merge pull request #11 from Yoast/feature/update-phpunit-polyfills
jrfnl Aug 10, 2021
9c5efea
Composer: update Parallel Lint
jrfnl Sep 21, 2021
6dac193
Merge pull request #13 from Yoast/feature/composer-update-parallel-lint
jrfnl Sep 22, 2021
c50f033
Composer: update to YoastCS 2.2.0
jrfnl Sep 23, 2021
2211931
PHPCS: minor tweaks to the ruleset
jrfnl Sep 23, 2021
edc5533
Merge pull request #15 from Yoast/feature/composer-update-to-yoastcs-…
jrfnl Sep 23, 2021
f16e062
Integration test bootstrap: add fall-back support for typical WP-CLI …
jrfnl Sep 23, 2021
ae89de5
Merge pull request #16 from Yoast/feature/12-improve-support-for-scaf…
jrfnl Sep 23, 2021
022cf64
TestCase: update for PHPUnit Polyfills 1.0.0
jrfnl Sep 24, 2021
ad358a8
Merge pull request #17 from Yoast/feature/integration-testcase-update…
jrfnl Sep 24, 2021
253ba0c
Documentation: various tweaks
jrfnl Sep 24, 2021
6f8229e
Merge pull request #18 from Yoast/feature/documentation-update-for-re…
jrfnl Sep 24, 2021
33d3eab
CS: minor consistency fix
jrfnl Sep 24, 2021
0b5a33e
Merge pull request #19 from Yoast/feature/cs-minor-fix
jrfnl Sep 24, 2021
db16726
Integration tests: update the bootstrap for compatibility with WP 5.9
jrfnl Aug 10, 2021
18e7e97
Integration tests TestCase: double the class for full compat with all…
jrfnl Sep 24, 2021
b35d6fb
Merge pull request #20 from Yoast/feature/compatibility-with-wp-5.9
jrfnl Sep 24, 2021
2e9e7e8
PHPUnit: update configuration
jrfnl Sep 25, 2021
763145f
Merge pull request #21 from Yoast/feature/phpunit-update-config
jrfnl Sep 25, 2021
0048a56
BrainMonkey\YoastTestCase: make the `is_multisite()` stub more versatile
jrfnl Sep 26, 2021
1ae9c2c
Merge pull request #22 from Yoast/feature/brainmonkey-testcase-improv…
jrfnl Sep 26, 2021
9a93f7b
README: update for version 1.0.0 and WP 5.9
jrfnl Sep 27, 2021
29554c5
Merge pull request #23 from Yoast/feature/update-readme-integration-t…
jrfnl Sep 27, 2021
67f642b
Changelog for release 1.0.0
jrfnl Sep 27, 2021
8d41d47
Merge pull request #24 from Yoast/feature/changelog-release-1.0.0
jrfnl Sep 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL, display_errors=On
coverage: none

# Install dependencies and handle caching in one go.
Expand Down
26 changes: 26 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
-->

<rule ref="Yoast">
<properties>
<!-- Provide the plugin specific prefixes for all naming related sniffs. -->
<property name="prefixes" type="array">
<element value="Yoast\WPTestUtils"/>
</property>
</properties>

<!-- Use CamelCaps file names to be more in line with the naming conventions used in PHPUnit. -->
<exclude name="Yoast.Files.FileName"/>

Expand Down Expand Up @@ -90,6 +97,16 @@
<exclude-pattern>/src/*/bootstrap*\.php$</exclude-pattern>
</rule>

<!-- Declaring a few WordPress native constants. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound">
<exclude-pattern>/src/BrainMonkey/bootstrap\.php$</exclude-pattern>
</rule>

<!-- These duplicate classes are by design. -->
<rule ref="Generic.Classes.DuplicateClassName">
<exclude-pattern>/src/WPIntegration/TestCase*\.php$</exclude-pattern>
</rule>

<!-- Allow for camelCase method and variable names to be more in line with PHPUnit and BrainMonkey. -->
<rule ref="WordPress.NamingConventions.ValidFunctionName">
<exclude-pattern>/src/Helpers/*\.php$</exclude-pattern>
Expand All @@ -98,6 +115,15 @@
<exclude-pattern>/src/Helpers/*\.php$</exclude-pattern>
</rule>

<!-- Ignore word count for object names in tests. -->
<rule ref="Yoast.NamingConventions.ObjectNameDepth.MaxExceeded">
<exclude-pattern>/tests/*\.php$</exclude-pattern>
</rule>

<!-- Test fixtures are not the actual tests. -->
<rule ref="Yoast.Commenting.TestsHaveCoversTag">
<exclude-pattern>/tests/*/Fixtures/*\.php$</exclude-pattern>
</rule>

<!--
#############################################################################
Expand Down
45 changes: 43 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,58 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses

_Nothing yet._

## [1.0.0] - 2021-09-27

WordPress 5.9 contains significant changes to the WordPress native test suite, which impacts **integration tests**.<br/>
Please see the [dev-note about these changes on Make WordPress](https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/) 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.<br/>
See the [Make Core dev-note](https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/#integration-tests-ci-changes) 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]<br/>
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.<br/>
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, includes 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`](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/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.

[#16]: https://github.com/Yoast/wp-test-utils/pull/16
[#17]: https://github.com/Yoast/wp-test-utils/pull/17
[#20]: https://github.com/Yoast/wp-test-utils/pull/20
[#22]: https://github.com/Yoast/wp-test-utils/pull/22

[Pierre Gordon]: https://github.com/pierlon
[Pascal Birchler]: https://github.com/swissspidy


## [0.2.2] - 2021-06-21

### Changed
* The [PHPUnit Polyfills] dependency has been updated to require [version `^1.0.0`](https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/1.0.0) (was `^0.2.0`).
* Improved compatibility with the test setup as created via the WP CLI `scaffold` command.
* Improved compatibility with the test setup as created via the [WP-CLI `scaffold` command].
* CI is now run via GitHub Actions.


## [0.2.1] - 2020-12-09

### Changed
* The [BrainMonkey] dependency has been updated to require version `^2.6.0` (was `^2.5.0`).
* `Yoast\WPTestUtils\BrainMonkey\YoastTestCase`: removed stubs for `wp_json_encode()` and `user_trailingslashit()`.
* `Yoast\WPTestUtils\BrainMonkey\YoastTestCase`: removed stubs for `wp_json_encode()` and `user_trailingslashit()`.<br/>
These are now stubbed in the BrainMonkey library.


Expand All @@ -47,6 +86,7 @@ Initial release.


[Unreleased]: https://github.com/Yoast/wp-test-utils/compare/main...HEAD
[1.0.0]: https://github.com/Yoast/wp-test-utils/compare/0.2.2...1.0.0
[0.2.2]: https://github.com/Yoast/wp-test-utils/compare/0.2.1...0.2.2
[0.2.1]: https://github.com/Yoast/wp-test-utils/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/Yoast/wp-test-utils/compare/0.1.1...0.2.0
Expand All @@ -56,3 +96,4 @@ Initial release.
[BrainMonkey]: https://github.com/Brain-WP/BrainMonkey/releases
[PHPUnit Polyfills]: https://github.com/Yoast/PHPUnit-Polyfills/releases
[README]: https://github.com/Yoast/wp-test-utils/blob/develop/README.md
[WP-CLI `scaffold` command]: https://github.com/wp-cli/scaffold-command/
Loading