Skip to content

Commit

Permalink
Add documentation about deprecating methods
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
johnpbloch committed Dec 22, 2016
1 parent 4d6e120 commit 817f237
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ It's not uncommon for tests to need to declare "passthrough/passthru" functions:

You can still test things like invocation count by passing the `times` argument in the second parameter, just like `\WP_Mock::userFunction()`.

### Deprecated methods

Please note that `WP_Mock::wpFunction()` and `WP_Mock::wpPassthruFunction()` are both officially deprecated. Replace all uses of them with `WP_Mock::userFunction()` and `WP_Mock::passthruFunction()`. If you use either of the deprecated methods, WP_Mock will mark those tests as risky. Your tests will still count as passing, but PHPUnit will start telling you which tests are causing issues.

### Mocking actions and filters

The [hooks and filters of the WordPress Plugin API](http://codex.wordpress.org/Plugin_API) are common (and preferred) entry points for third-party scripts, and WP_Mock makes it easy to test that these are being registered and executed within your code.
Expand Down

0 comments on commit 817f237

Please sign in to comment.