PHPUnit: Mock sleep() in 2 Ways Without Waiting
Originally published at recca0120.github.io
When your code contains sleep() calls, tests have to wait too. For example, this retry logic makes each test run take 15 seconds:
// app/Http/Controllers/HomeController.php
namespace App\Http\Controllers;
...
recca0120.hashnode.dev2 min read