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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners