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.
Published on Nov 11th, 2015.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.