Brain Monkey can be used with any testing framework. Examples in this page will use PHPUnit, but the concepts are applicable to any testing framework.
The procedure below includes the setup needed for testing PHP functions, so there is no need to apply what said here and additionally what said in the section PHP Functions / Setup: steps below are enough to use all Brain Monkey features, including functions utilities.
After Brain Monkey is part of the project (see Getting Started / Installation), to be able to use its features you need to require vendor autoload file before running tests (e.g. PHPUnit users will probably require it in their bootstrap file).
After that, you need to call a function before any test, and another after any test.
These two functions are:
Brain\Monkey\setUp() has to be run before any test
Brain\Monkey\tearDown() has to be run after any test
PHPUnit users will probably want to add these methods to a custom test case class: