Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.

About This Episode

In Laravel 5.3, a number of facades provide a static fake method that can be called to replace the underlying class with a minimal fake version, for the purposes of testing. A fake is a type of test double, where you create a light, barebones implementation of a particular API or interface in order to satisfy or assist a given test.

Consider a scenario where the code you're testing fires an event. Well, it's possible that you don't want the associated event listeners to be triggered, as part of that test. Instead, we can use a double: replace the underlying event dispatcher with a fake version. Now, we can assert that the necessary event was triggered, without worrying about any of the side effects from firing an actual real event. It sounds complicated, but I assure you that it's all very simple.

Published on Sep 14th, 2016.

Episodes

    1. EPISODE 1 7:18 Free
    2. EPISODE 3 3:20 Free
    3. EPISODE 4 10:11 Free
    4. EPISODE 5 3:32 Free
    5. EPISODE 6 8:02 Free
    6. EPISODE 7 5:27 Free
    7. EPISODE 8 4:14 Free
    8. EPISODE 9 11:16 Free
    9. EPISODE 10 15:51 Free
    10. EPISODE 12 10:02 Free
    11. EPISODE 13 14:49 Free
    12. EPISODE 14 7:30 Free
    13. EPISODE 17 11:22 Free
    14. EPISODE 18 14:36 Free
Back to Series Button