PackageTrack
Sign in Get early access

10up/wp_mock

A mocking library to take the pain out of unit testing for WordPress

1.1.1 3.3M downloads/mo #2659 most downloaded on Packagist 10up/wp_mock

What this package is like to depend on

Last release 8 months ago

02 Dec 2025

Release timing varies

gaps range from 2 weeks to 3.6 years

Nearly every release is documented

notes for 12 of 12 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

12 releases · first in 2014

1 release in the last 12 months

see the full history below

Release timeline

12 releases · Dec 2014 to Dec 2025
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 12
  1. 1.1.1 02 Dec 2025
    Release notes

    What's Changed

    Full Changelog: 1.1.0...1.1.1

    Open source →
    Release notes

    Fixed

    • Address PHP deprecation warnings about implicitly nullable parameters
    • Allow onFilter(...)->withAnyArgs() to be used multiple times on a single tests
    Open source →
  2. 1.1.0 12 Mar 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 1.0.1...1.1.0

    Open source →
    Release notes

    Added

    • Add support for types in expectFilter() mocks
    • Add support for withAnyArgs() method for onFilter() calls

    Fixed

    • Prevent IDEs/phpstan from detecting exceptions in mocked functions that don't actually throw in WordPress core (e.g. esc_html())
    • Typos in docs and function name (old function iExcpectWhenIRun() still exists but has been deprecated)
    Open source →
  3. 1.0.1 22 Jan 2024
    Release notes

    What's Changed

    • Update WP_Mock::expectHookNotAdded() with new params by @unfulvio-godaddy in #234
    • Update PHP dev dependencies, ensure compatibility with PHP 8.3 environments and run tests with PHP 8.3 by @unfulvio-godaddy in #237

    Full Changelog: 1.0.0...1.0.1

    Open source →
    Release notes

    Changed

    • Updated WP_Mock::expectHookNotAdded() with new params
    • Updated PHP dependencies to ensure compatibility with PHP 8.3
    Open source →
  4. 1.0.0 26 Jul 2023
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 0.5.0...1.0.0

    Open source →
    Release notes

    Added

    • Added and documented return types in codebase
    • New AccessInaccessibleClassMembers helpers in test case
    • Move documentation to GitBook

    Changed

    • Require PHP 7.4
    • Update dependencies (Mockery 1.6, PHPUnit 9.6)
    • Remove deprecated methods in WP_Mock main class
    • Update Hook::safe_offset() to handle closure

    Fixed

    • IsEqualHtml extends PHPUnit Constraint
    • Improve responder handling of closures
    Open source →
  5. 0.5.0 01 Nov 2022
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 0.4.2...0.5.0

    Open source →
    Release notes

    Added

    • New AnyInstance matcher

    Changed

    • Add compatibility with PHPUnit 9
    • Require PHP 7.3
    • Mocker function for _n() to evaluate singular or plural

    Fixed

    • Patchwork not loaded error (WP_Mock::setUsePatchwork(true) was broken)
    • Address call to undefined method getAnnotations error from test class
    • Support for latest PHPUnit versions
    Open source →
  6. 0.4.2 16 Mar 2019
    Release notes

    Full Changelog: 0.4.1...0.4.2

    Open source →
    Release notes

    Added

    • Minor Filter/Action/Hook Assertion Bugfix
    • Please note: As with the previously-tagged release, this is not necessarily a stable release!
    Open source →
  7. 0.4.1 26 Feb 2019
    Release notes

    This release brings us up to date with the latest release of PHPUnit.

    Please note: As with the previously-tagged release, this is not necessarily a stable release!

    What's Changed

    New Contributors

    Full Changelog: 0.4.0...0.4.1

    Open source →
    Release notes

    Added

    • PHPUnit 8 Compatibility
    • This release brings us up to date with the latest release of PHPUnit.
    • Please note: As with the previously-tagged release, this is not necessarily a stable release!
    Open source →
  8. 0.4.0 17 Jan 2019
    Release notes

    This release brings us up to date both with PHPUnit and with PHP itself. The minimum version of PHP now supported by the project is 7.1.

    What's Changed

    • Add PHP as language in code blocks by @ocularrhythm in #120
    • Add a message to the internal functions exception by @johnpbloch in #123
    • PHPUnit 7.x Compatibility Fixes by @ericmann in #129

    New Contributors

    • @ocularrhythm made their first contribution in #120

    Full Changelog: 0.3.0...0.4.0

    Open source →
    Release notes

    Added

    • PHPUnit 7 Compatibility
    • This release brings us up to date both with PHPUnit and with PHP itself. The minimum version of PHP now supported by the project is 7.1.
    • Please note: As with the previously-tagged release, this is not necessarily a stable release!
    Open source →
  9. 0.3.0 03 Dec 2017
    Release notes

    This release brings us up to date both with PHPUnit and with PHP itself. The minimum version of PHP now supported by the project is 7.0.

    What's Changed

    New Contributors

    Full Changelog: 0.1.1...0.3.0

    Open source →
    Release notes

    Added

    • This release brings us up to date both with PHPUnit and with PHP itself. The minimum version of PHP now supported by the project is 7.0.
    • Please note: As with the previously-tagged release, this is not necessarily a stable release!
    Open source →
  10. 0.2.0 19 Jul 2017
    Release notes

    This release moves to using static, tagged versions hosted on Packagist. Aside from a handful of bugfixes, it's equivalent to the dev-dev version many have been using before July 2017. Moving forward, all versions will be static and tagged.

    What's Changed

    New Contributors

    Full Changelog: 0.1.1...0.2.0

    Open source →
    Release notes

    Added

    • Unstable Distributable Release
    • This release moves to using static, tagged versions hosted on Packagist. Aside from a handful of bugfixes, it's equivalent to the dev-dev version many have been using before July 2017. Moving forward, all versions will be static and tagged.
    • Please note: As with the previously-tagged release, this is not a stable release! We strongly encourage you to use the 1.0.x-dev source release until we release a stable 1.0 version.
    Open source →
  11. 0.1.1 31 Mar 2015
    Release notes

    Added

    • Better documentation and phpDocumentor output
    Open source →
  12. 0.1.0 09 Dec 2014
    Release notes

    Added

    • Unstable Distributable Release
    • Currently, we only have source releases on Packagist (dev-trunk and 1.0.x-dev). This will be a distributable release that will allow local caching of the library so that not every use needs to be a git clone.
    • Please note: this is not a stable release! We strongly encourage you to use the 1.0.x-dev source release until we release a stable 1.0 version.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive