On NetTuts.com they’ve kicked off a new series of tutorials teaching you about Laravel development but using the principles and testing of behavior-driven development (BDD). In this first part of the series they get you started with the basic environment and a few simple tests.
Welcome to this series about developing Laravel applications using a behavior-driven development (BDD) approach. Full stack BDD can seem complicated and intimidating. There are just as many ways of doing it as there are developers. In this series, I will walk you through my approach of using Behat and PhpSpec to design a Laravel application from scratch. There are many resources on BDD in general, but Laravel specific material is hard to find. Therefore, in this series, we will focus more on the Laravel related aspects and less on the general stuff that you can read about many other places.
He talks about what it means to „describe behavior“ versus other kinds of testing and introduces the sample application they’ll be creating to show these principles: a time tracker. Following this, they help you install the needed tools (via Composer) and initialize the directory to be ready for the Behat/Phpspec tests you’ll create. An example of a basic Feature is included, testing the initial Laravel „Welcome“ page it defaults to and how to execute it. Finally, following the ideals of BDD, they show how to implement the „Given I am logged in“ step first in the test then in the Laravel application.