Category: Laravel, PHP

I have made a video serie for this very topic, so if you do not understand some concepts below, it is a good reference point that covers a lot more why instead of what: I have been working in many companies and the pattern that I see over and over is that once a service or product takes off in a startup, it then needs some testing automation made by developers, otherwise teams ship software full of bugs to production. This article is about to explain you the bare fundamentals and focus on Feature Tests in Laravel.

Because it says it all and the rules are simple: In Laravel the UI tests are called Feature test, they hit the REST API that you expose writing your microservices and this article is focusing on writing them.

I strongly recommend to watch a videos on top of this article to see how I actually created it using Test Driven Development, however I will be more than happy to shed some light here: Ok once you have your happy path, it is time to check some of your negative cases.

I hope this simple example shows how to create feature tests in laravel and now it will become standard for you whenever making a new endpoint in your application.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners