News

Speeding up PHP unit tests

Published
Speeding up PHP unit tests image

Chris Duell gives some tips on speeding up your PHP Unit Tests by using an in-memory database and also having your tests autorun when files change.

Testing is still something I feel I need to almost force myself to do, and what previously made it worse was that my tests took so long to run. While working on elev.io development for to create a better way for you to support your users (seriously, check it out and support what I do), while we only had 50% code coverage, those tests already took over 35 seconds to complete.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Filed in

Sponsored

masteringlaravel logo
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review

The latest

View all →
Pause Polling in Background Tabs in Inertia.js v3.9 image

Pause Polling in Background Tabs in Inertia.js v3.9

Read article
Look What You Helped Me Build image

Look What You Helped Me Build

Read article
BashBox: A Sandboxed Bash Interpreter for AI Agents in PHP image

BashBox: A Sandboxed Bash Interpreter for AI Agents in PHP

Read article
Running Laravel's Scheduler on Multiple Servers image

Running Laravel's Scheduler on Multiple Servers

Read article
Laravel Fake Assertions Now Accept Property Arrays image

Laravel Fake Assertions Now Accept Property Arrays

Read article
Route::query() and Model defaults() in Laravel 13.35 image

Route::query() and Model defaults() in Laravel 13.35

Read article