Back to the Learning!

Laracasts is packed full with over 1,000 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Published On Dec. 16th 2014

Testing Jargon: Stubs

Episode 3 Run Time 7:04

Download

A mock allows us to enforce that certain messages are sent to various collaborators. A stub is a bit different. Think of a stub as a stand-in that returns any kind of hard-coded data. "When this method is called, return false." Let's dig into this idea a bit more.