What is Brain Monkey and when to use it
masterBrain Monkey is a unit test utility for PHP designed to facilitate testing in isolation. It provides two distinct sets of features:
- General Function Mocking: A framework-agnostic tool that allows you to mock and test any PHP function. This is useful for any PHP project, regardless of whether it uses a specific framework, and it is compatible with any testing framework (e.g., PHPUnit, PHPSpec).
- WordPress-Specific Testing: A specialized set of tools designed specifically for testing WordPress code, which relies heavily on global functions.
You can use the general function mocking features independently of the WordPress-specific tools.