Unlock your potential with a Pro Membership
Here is where you propel your career forward. Come join us today. Learn more.
`stubs()`
Lab: Unit Testing with Brain Monkey
Video Runtime: 04:04
Stubs give you a way to redefine multiple functions by passing an array to Brain Monkey. This toolset is handy for things such as WordPress escaping and internationalization functions, as we can bulk define these functions in your Test Case. Here is an example of how we do it with the Beans framework.
-
Click here to view the code I use.
What to Do Next?
Whoever says that coding is hard, just smack them.
Episodes
Total Lab Runtime: 03:21:08
- 0 Lab Setupfree 07:07
- 1 The Problem - Why We Need to Simulatefree 24:50
- 2 Behind the Scenes of Redefining a Functionfree 20:31
- 3 Brain Monkey's Toolset Overviewpro 09:04
- 4 Anatomy of the Test Expectationpro 11:51
- 5 setUp and tearDownpro 09:51
- 6 Create a Test Classpro 20:42
- 7 `when()`pro 14:23
- 8 `when()` - Behavior Optionspro 14:26
- 9 `when()` - Code Challengepro 08:27
- 10 `expect()`pro 11:40
- 11 `with()`pro 05:44
- 12 More with `with()`pro 10:02
- 13 `with()` - Code Challengepro 09:53
- 14 `expect()` - Behavior Optionspro 07:47
- 15 `andAlsoExpectIt()`pro 10:46
- 16 `stubs()`pro 04:04