NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #737 most downloaded on Packagist
Mocking utility for PHP functions and WordPress plugin API
Latest stable
2.7.0
Last release 9 months ago
05 Feb 2026
Release timing varies
gaps range from 9 days to 2.8 years
Most releases are documented
notes for 27 of 32 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
32 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
In particular, this affects the function mocks of doing_action() , doing_filter() , do_action_deprecated() , apply_filters_deprecated() , has_filter()…
has_filter() and has_action() now support the $priority parameter as added in WordPress 6.9 by @jrfnl.doing_action(), doing_filter(), do_action_deprecated(), apply_filters_deprecated(), has_filter() and has_action().Full Changelog: 2.6.2...2.7.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Several updates and improvements on GH Actions, by @jrfnl
wp_validate_boolean test assertions by @paulshryock_n_noop, _nx_noop, translate_nooped_plural by @gmazzapFull Changelog: 2.6.1...2.6.2
Compatibility with PHP 8.1 (props @jrfnl )
Added stub for esc_xml() , wp_json_encode , user_trailingslashit() , _n , and _nx (props @jrfnl )
esc_xml(), wp_json_encode, user_trailingslashit(), _n, and _nx (props @jrfnl)HooksStorage::hookPriority (internal)
Moved CI from Travis to GitHub actions
Nothing
UnitTestCase parent classNothing
Updated DealerDirect Composer plugin props @jrfnl
Nothing.
Nothing.
Stubs for do_action_deprecated and apply_filters_deprecated
do_action_deprecated and apply_filters_deprecatedHookStorage::parseArgsToAdd, props @szepeviktorbyDefault needs to be allowed for functions expectations
byDefault needs to be allowed for functions expectationsActions\expectRemoved and Filters\expectRemoved (see #45 )
Actions\expectRemoved and Filters\expectRemoved (see #45)Functions\stubTranslationFunctions()Functions\stubEscapeFunctions()is_wp_error() and absint@throws occurrencesMake sure that static methods can be passed as string, as this is an acceptable way in PHP to pass a callable. See #47
Mockery is now allowed in version range >=0.9 < 0.2. Mockery v1 is compatibe with BM itself, and if it breaks something in the package _using_ BM, it
Nothing
Nothing
Compatibility with PHPUnit and Patchwork on autoload.
patchwork-loader.php which loads Patchwork, is not loaded from Composer autoload, but manually on setUp() or on first container instantiation, based on what occurs first.Functions\stubs() API method for multiple function definitions.Patchwork is now allowed in 2.* version (was 2.0.*).
Nothing
Nothing
Improved apply_filters behavior to fix 100% of cases in #16
apply_filters behavior to fix 100% of cases in #16Nothing
Nothing
Nothing published for this version
[BREAKING] API entry-points are now functions and not methods (also Actions::expectFired() is now Actions\expectDone())
Actions::expectFired() is now Actions\expectDone())->zeroOrMoreTimes() to ->atLeast()->once()has_filter / has_action is now changed to include closure arguments and distinguish normal closures from static closurescallable check: function that requires callable arguments (like add_action / add_filter), does not throw exception if the given supposed-to-be callable is not available (e.g. not mocked function or not loaded class)__return_true & co) (see https://github.com/Brain-WP/BrainMonkey/blob/master/inc/wp-helper-functions.php )doing_action() and doing_filter() in callbacks used to respond to hooksandReturnFirstArg() expectation methodandAlsoExpectIt() expectation methodapply_filters default behavior. See #16Migrating from v1 guide available here: https://brain-wp.github.io/BrainMonkey/docs/migrating-from-v1.html
## Fixed _Nothing_ ## Changed - Updated Patchwork to version 2 ## Added _Nothing_
Nothing
Nothing
has_action() / has_filter() can now be called with just hook name and they will return true if the given hook has _any_ callback attached (just like t
has_action() / has_filter() can now be called with just hook name and they will return true if the given hook has any callback attached (just like they work in core). See #18Nothing
Nothing
did_action() / Filters::apllied() now works with hooks that contain special chars
did_action() / Filters::apllied() now works with hooks that contain special charsNothing
Nothing
Hooks::sanitizeHookName() is a static function that was called dynamically
Hooks::sanitizeHookName() is a static function that was called dynamicallyBoth actions and filters can now be tested for same hook be fired / added more than once with different arguments. See #11
>=5.4) in composer.jsonnothing
Path of Patchwork (thanks @stephenharris)
justEcho() and echoArg()Expectation state persists among tests
Functions::when()->justEcho() to mock a function making it echo some valueFunctions::when()->echoArg() to mock a function making it echo one of received argumentsNothing published for this version
Allow whenHappen() for added hooks
whenHappen() for added hookscurrent_filter() always return original hook name, even when hook names contain special chars, see #1Improved hooks name sanitization, to avoid names collision.
Improved hooks name sanitization, to avoid names collision.
Hamcrest-PHPUnit conflict has been solved. No need for the hack introduced in v1.1.2
Hamcrest-PHPUnit conflict has been solved. No need for the hack introduced in v1.1.2
Nothing published for this version
Nothing published for this version
Moved all setup to Monkey class
Moved all setup to Monkey class
Nothing published for this version
One column per quarter.