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.


    1. Important Directory Changes

      EPISODE 1 7:18 Free
    2. The Global Cache Helper

      EPISODE 3 3:20 Free
    3. The JavaScript Suggestion

      EPISODE 4 10:11 Free
    4. Simpler Pagination

      EPISODE 5 3:32 Free
    5. Mailables

      EPISODE 6 8:02 Free
    6. Foreach, and the Loop Object

      EPISODE 7 5:27 Free
    7. Toggle Pivot Table Records

      EPISODE 8 4:14 Free
    8. Notifications: Email

      EPISODE 9 11:16 Free
    9. Notifications: Database

      EPISODE 10 15:51 Free
    10. Super Simple File Uploading

      EPISODE 12 10:02 Free
    11. Laravel Passport

      EPISODE 13 14:49 Free
    12. Closure-Based Commands

      EPISODE 14 7:30 Free
    13. Facade Fakes

      EPISODE 17 11:22 Free
    14. Fluent Validation Rules

      EPISODE 18 14:36 Free
Back to Series Button