Source: blog.deleu.dev

PHPUnit with Bref
One thing I learned to love with Docker was the easy ability to run phpunit with the exact same environment that will be used in production. Whenever I'm setting up a release pipeline, I like to build a Docker image, start a container from that image, enter it and run the project test code.

Yes, if one of my dev dependencies is not actually a dev dependency things can still break.

But the point is to minimize, as much as possible, the difference between production and the test environment.

Bref comes with a handy Docker image for tests which we can find at https://hub.docker.com/r/bref/php-74.
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