10up / wp_mock

WordPress API Mocking Framework
https://wp-mock.gitbook.io
Other
676 stars 70 forks source link

Add test coverage to handler and return sequence classes #219

Closed unfulvio-godaddy closed 1 year ago

unfulvio-godaddy commented 1 year ago

Summary

Adds test coverage for the Handler and ReturnSequence classes. These classes were refactored and moved into the WP_Mock/Functions namespace.

Even though these methods are internal, it's a minor API break. However, we are considering to tag v1.0.0 soon so it should be acceptable.

The only change is for devs implementing their own function mocks outside of WP_Mock::userFunction() etc. by directly calling \WP_Mock\Functions\Handler::handleFunction(__FUNCTION__, func_get_args()); -- this is documented in the docs.

Details

Note: this depends on #216 to be merged first.

Contributor checklist

Testing

Reviewer checklist

- [x] Review and merge #216 first - [ ] Code changes review - [ ] Documentation changes review - [ ] Unit tests pass - [ ] Static analysis passes
coveralls commented 1 year ago

Coverage Status

coverage: 65.421% (+5.2%) from 60.188% when pulling 482a9e8fdb8b6654f7e0f3a7ed697bd70f7af8c8 on chore/add-test-coverage-to-handler-and-return-sequence into 7934d33008bce0f6dee66c31dd306928980cdeee on trunk.

unfulvio-godaddy commented 1 year ago

note for reviewers:

as for this moment there are some GitHub issues also reported in https://www.githubstatus.com/ where some PR functions in GH are degraded - I'm pushing commits to this PR and they appear to hold in git (via CLI) but they don't show up in this PR and in the GH workflow - you may be able however to git pull the changes I have applied