Category: Laravel, PHP

I love using Test Driven Development a.k.a TDD in my projects, thats why unit test become part of my coding life. I always use Laravel’s RefreshDatabase trait in my unit test, to make sure the test will refresh all the database structure before begin the test. Having fresh database will add consistency in my tests.

The initiation time for testing become longer, because my test will always refresh the database every time I start the unit test.

Whenever I want to deploy and need to test all of my project files, I will run the test using RefreshDatabase trait.
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