diff --git a/docs/usage/using-wp-mock.md b/docs/usage/using-wp-mock.md index 7f9f7e8..4235490 100644 --- a/docs/usage/using-wp-mock.md +++ b/docs/usage/using-wp-mock.md @@ -54,10 +54,17 @@ Calling `WP_Mock::userFunction()` will dynamically define the function for you i return \WP_Mock\Functions\Handler::handleFunction(__FUNCTION__, func_get_args()); ``` + +{% hint style="warning" %} + **Important!** Note how in the above test class `WP_Mock\Tools\TestCase` was extended instead of `PHPUnit\Framework\TestCase`. This is because WP_Mock provides a custom test case class that extends PHPUnit's test case class and adds additional functionality to it. Ideally, you should always extend `WP_Mock\Tools\TestCase` instead of `PHPUnit\Framework\TestCase` when using WP_Mock. _If you do not wish to extend WP_Mock own test case class_ you should make sure to call `WP_Mock::setUp()` and `WP_Mock::tearDown()` in your test case's `setUp()` and `tearDown()` methods respectively. +See [WP_Mock Test Case Documentation](../tools/wp-mock-test-case.md) + +{% endhint %} + ## Using Mockery expectations The `WP_Mock::userFunction()` class will return a complete `Mockery\Expectation` object with any expectations added to match the arguments passed to the function. This enables using [Mockery methods](http://docs.mockery.io/en/latest/reference/expectations.html) to add expectations in addition to, or instead of using the arguments array passed to `userFunction`.