Skip to content

Update WP_Mock::expectHookNotAdded() with new params#234

Merged
agibson-godaddy merged 9 commits intotrunkfrom
233-fix/add-expect-hook-not-added-parameters
Aug 16, 2023
Merged

Update WP_Mock::expectHookNotAdded() with new params#234
agibson-godaddy merged 9 commits intotrunkfrom
233-fix/add-expect-hook-not-added-parameters

Conversation

@unfulvio-godaddy
Copy link
Copy Markdown
Member

@unfulvio-godaddy unfulvio-godaddy commented Aug 16, 2023

Summary

Adds method params to expectHookNotAdded for priority and allowed arguments that are symmetrical to expectHookAdded - and carries them over the aliased functions for filter and action hooks.

This way, we can set more specific expectations than assuming hooks will always have 10, 1 as priority/args allowed.

The PR also improves the WP_Mock hook methods phpdocs and types to match current standards.

Closes: #233

Contributor checklist

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly
  • I have added tests to cover changes introduced by this pull request
  • All new and existing tests pass

Reviewer checklist

  • Code changes review
  • Documentation changes review
  • Unit tests pass
  • Static analysis passes

@unfulvio-godaddy unfulvio-godaddy added the Bug Bug report or pull requests that addresses a bug label Aug 16, 2023
@unfulvio-godaddy unfulvio-godaddy self-assigned this Aug 16, 2023
@unfulvio-godaddy unfulvio-godaddy changed the title Update WP_Mock::expectHookNotAdded with new params Update WP_Mock::expectHookNotAdded() with new params Aug 16, 2023
@unfulvio-godaddy unfulvio-godaddy requested a review from a team August 16, 2023 04:20
@coveralls
Copy link
Copy Markdown

coveralls commented Aug 16, 2023

Coverage Status

coverage: 66.312% (+0.7%) from 65.646% when pulling 3d72278 on 233-fix/add-expect-hook-not-added-parameters into de812e4 on trunk.

Copy link
Copy Markdown
Contributor

@agibson-godaddy agibson-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🙌

@agibson-godaddy agibson-godaddy merged commit e9e421c into trunk Aug 16, 2023
@agibson-godaddy agibson-godaddy deleted the 233-fix/add-expect-hook-not-added-parameters branch August 16, 2023 11:55
@jeffpaul jeffpaul added this to the v1.1.0 milestone Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug report or pull requests that addresses a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expectHookNotAdded should accept priority and arguments parameters with defaults as expectHookAdded

4 participants