WP_Mock provides useful helpers for expectFilterAdded and expectFilterNotAdded, and [their] companion actions. However, we have no canonical way of checking remove_action nor remove_filter calls.
coverage: 64.889% (-1.6%) from 66.445%
when pulling 67017782c351c0fceb9d74c53545cb424e1566a1 on BrianHenryIE:add/remove-action-remove-filter
into 48b7f22934a4351e45e336f09263ee27fc9ddcbe on 10up:trunk.
coverage: 67.522% (+1.1%) from 66.445%
when pulling 7d01fcb251bd6be87396602422d13a810ec58b4b on BrianHenryIE:add/remove-action-remove-filter
into 48b7f22934a4351e45e336f09263ee27fc9ddcbe on 10up:trunk.
coverage: 67.651% (+1.2%) from 66.445%
when pulling cd4cff50eca56e67491aafbd772f0e7e988bb388 on BrianHenryIE:add/remove-action-remove-filter
into 48b7f22934a4351e45e336f09263ee27fc9ddcbe on 10up:trunk.
coverage: 67.651% (+1.2%) from 66.445%
when pulling f56c5575258aaa920acd18b87986f4011af1a04e on BrianHenryIE:add/remove-action-remove-filter
into 48b7f22934a4351e45e336f09263ee27fc9ddcbe on 10up:trunk.
coverage: 67.651% (+1.3%) from 66.312%
when pulling 32b889800ce486f32f2bb777a38616bd06a630d2 on BrianHenryIE:add/remove-action-remove-filter
into 010d556e0482e4d94776a5b0641429dca00333e4 on 10up:trunk.
Summary
As said in #157:
See:
remove_filter()
.Closes: #157
Details
It's really just a convenience function on top of
WP_Mock::userFunction()
.We're using
array_filter()
there to handle the optional use of$priority
inremove_filter()
.::expectFilterNotRemoved()
is the same with'times' => 0
.Contributor checklist
Testing
Reviewer checklist
- [ ] Code changes review - [ ] Documentation changes review - [ ] Unit tests pass - [ ] Static analysis passes