Рет қаралды 3,557
Learn how to replace objects in your PHP tests with test-doubles using stubs and mocks. This is a vital skill which will enable you to test your code more efficiently and with tighter focus.
💻 Check out THE FULL COURSE here:
www.garyclarke.tech/p/testing...
🆓 Join GaryClarke Tech and claim your $49 Docker + PHP course for FREE here:
www.garyclarke.tech/p/php-pro...
👇Follow me on Social Media:
Twitter: / garyclarketech
Linkedin: / garyclarketech
💕Show support:
www.paypal.com/donate/?hosted...
0:00 PHPUnit Test Doubles
8:09 Testing Expectations
11:40 Faking Method Return Values
16:47 Testing Consecutive Returns
20:30 Throwing Exceptions From Stubbed Methods
23:09 Will Return Callback
27:22 Test Faked Methods Receive Correct Args
33:33 Test Correct Args With Callbacks
39:54 The Mock Builder