A comprehensive step-by-step video course on designing robust Laravel applications with TDD.
When I was first learning how to test, every example I could find made it seem fairly straightforward.
"Assert 5+5 equals 10? Sure, piece of cake!"
But as soon as I tried to test a real application, I was paralyzed.
"What's the very first test I'm supposed to write for this brand new app?"
"How do I test that this email gets sent?"
"What about this code that needs to talk to the Stripe API?"
Simple examples are fine for learning the basics, but I wanted to know how to apply this stuff to real products that I was actually building on the job.
I’ve spent the last 5 years figuring out how to build web applications with TDD; piecing things together from every resource I could get my hands on.
Test-Driven Laravel is the course I wish I'd had.
Ever since Adam helped tweak my approach to testing a bit, I really enjoy writing them a lot more.
Taylor Otwell, creator of Laravel
The biggest objective of this course is to teach you how to TDD something real; not just another cookie-cutter to-do app.
We cover fundamentals like:
...as well as hard topics, like:
Test-Driven Laravel teaches you how to design a solid test suite for a real-world, marketable product that you could actually charge money for.
Together we'll build TicketBeast, a platform for local concert promoters to sell tickets to their events.
Over the course of 166 lessons spanning just under 22 hours of content, we'll implement features like:
It’s huge, but it’s the most comprehensive TDD resource I’ve ever seen.
What Do We Build First?
Sketching out Our First Test
Getting to Green
Unit Testing Presentation Logic
Refactoring for Speed
Hiding Unpublished Concerts
Testing Query Scopes
Factory States
Introducing the Next Feature
Browser Testing vs Endpoint Testing
Outlining the First Purchasing Test
Faking the Payment Gateway
Adding Tickets to Orders
Encapsulating Relationship Logic in the Model
Getting Started with Validation Testing
Reducing Duplication with Custom Assertions
Handling Failed Charges
Preventing Ticket Sales to Unpublished Concerts
Outlining the First Test Case
Adding Tickets to Concerts
Refusing Orders When There Are No More Tickets
Finishing the Feature Test
Cancelling Failed Orders
Refactoring and Redundant Test Coverage
Cleaning Up Our Tests
Asserting Against JSON Responses
Returning Order Details
This Design Sucks
Persisting the Order Amount
Removing the Need to Cancel Orders
Preparing for Extraction
Extracting a Named Constructor
Precomputing the Order Amount
Uncovering a New Domain Object
You Might Not Need a Mocking Framework
Uh Oh, a Race Condition!
Requestception
Hooking into Charges
Uh Oh, a Segfault!
Replicating the Failure at the Unit Level
Reserving Individual Tickets
Reserved Means Reserved!
That Guy Stole My Tickets!
Cancelling Reservations
Refactoring Mocks to Spies
A Change in Behavior
Deleting Stale Tests
Cleaning up a Loose Variable
Moving the Email to the Reservation
Refactoring "Long Parameter List" Using "Preserve Whole Object"
Green with Feature Envy
Avoiding Service Classes with Method Injection
Generating a Valid Payment Token
Retrieving the Last Charge
Making a Successful Charge
Dealing with Lingering State
Don't Mock What You Don't Own
Using Groups to Skip Integration Tests
Handling Invalid Payment Tokens
The Moment of Truth
When Interfaces Aren't Enough
Refactoring Towards Duplication
Capturing Charges with Callbacks
Making the Tests Identical
Extracting a Contract Test
Extracting the Failure Case
Upgrading to Laravel 5.4
Removing the BrowserKit Dependency
Sketching Out Order Confirmations
Driving out the Endpoint
Asserting Against View Data
Extracting a Finder Method
Making Static Data Real
Deciding What to Test in a View
Decoupling Data from Presentation
Fixing the Test Suite
Stubbing the Interface
Updating Our Unit Tests
Confirmation Number Characteristics
Testing the Confirmation Number Format
Ensuring Uniqueness
Refactoring to a Facade
Promoting Charges to Objects
Leveraging Our Contract Tests
Storing Charge Details with Orders
Deleting More Stale Code
Feature Test and JSON Updates
Claiming Tickets When Creating Orders
Assigning Codes When Claiming Tickets
The Birthday Problem
Integrating Hashids
Dealing with Out of Sync Mocks
Wiring It All Together
Ready to Demo
Using a Fake to Intercept Email
Testing Mailable Contents
Cleanup and Demo
Testing the Login Endpoint
Should You TDD Simple Templates?
Namespacing Our Test Suite
Getting Started with Laravel Dusk
QA Testing the Login Flow
Preventing Guests from Adding Concerts
Adding a Valid Concert
Validation and Redirects
Converting Empty Strings to Null
Reducing Noise with Form Factories
Connecting Promoters and Concerts
Autopublishing New Concerts
Asserting Against View Objects
Avoiding Sort-Sensitive Tests
Refactoring Assertions with Macros
Viewing the Update Form
The First Update Test
Driving Out Basic Concert Updates
Restricting Updates to Unpublished Concerts
Storing the Intended Ticket Quantity
Updating the Other Tests
Refactoring Away Some Test Duplication
Creating Tickets at Time of Publish
Custom Factory Classes
Discovering a New Resource
Creating Published Concerts
Adding Concerts without Publishing
Pushing Logic Out of the View
More Custom Assertion Fun
Calculating Tickets Sold
Making the Progress Bar Work
Total Revenue and a Relationship Bug
Creating a Custom OrderFactory
Asserting Against Sort Order
Splitting Large Tests
Storing Messages for Attendees
Confirming That a Job Was Dispatched
Unit Testing the Job
Refactoring for Robustness
Mailable Testing Refresher and Demo
Upgrading to Laravel 5.5
Faking Uploads and File Systems
Storing Files and Comparing Content
Validating Poster Images
Optional Files and the Null Object Pattern
Testing Events
Testing the Event Listener
Resizing the Posted Image
Optimizing the Image Size
Upgrading Laravel and Deleting Some Code
Viewing an Unused Invitation
Viewing Used or Invalid Invitations
Registering with a Valid Invitation
Registering with an Invalid Invitation
Validating Promoter Registration
Testing a Console Command
Sending Promoters an Invitation Email
Test-Driving the Email Contents
Getting Cozy with Stripe Connect
Authorizing with Stripe
Exchanging Tokens
Unit Testing Middleware
Testing Callbacks with Invokables
Testing That Middleware Is Applied
Updating Factories and a Speed Trick
Total Charges for a Specific Account
Paying Promoters Directly
Splitting Payments with Stripe
It's Alive
This course has had a huge impact on my career. It’s easily worth 10x what I paid for it.
Learn everything you need to know about TDD in one comprehensive resource.
Definitely sign up for Adam’s course. Highly recommended.
Jeffrey Way, creator of Laracasts
Can I pay with PayPal?
Sure! To pay with PayPal, purchase the course through Gumroad and choose the "PayPal" option during checkout:
An account will be created for you automatically and you'll receive an access link via email shortly after purchasing.
Can I get an invoice?
Absolutely! Right after purchasing you'll be given a link to generate an invoice with any extra information you need to add for your own accounting purposes.
How do I access and watch the videos?
All of the videos are hosted inside of a custom platform I put together just for this course.
Instead of downloading 10 gigs of content, you just login to the course area with your GitHub account and you’ll have access to everything right away.
Every video is available both to stream and to download. You don’t need to fill up your hard drive if you don’t want to, but you can also download lessons for offline viewing whenever you like!
Can I purchase multiple licenses for my team at a reduced price?
Sure! Here's what I've got for team pricing:
Team licenses can be purchased through Gumroad:
Buy a team license via Gumroad
After purchasing, you'll receive an email with unique access links you can distribute to the people on your team.
I have another question!
No problem! Shoot me an email and let’s chat!
Hey! I'm @adamwathan, author of Refactoring to Collections, host of Full Stack Radio, and creator of Nitpick CI.
I teach everything I know on my blog, through screencasts, and at conferences around the world.