PHPUnit: Mock sleep() in 2 Ways Without Waiting
📰 Dev.to · Recca Tsai
When sleep() slows PHPUnit tests, extract a Clock class and use Mockery spy to replace it, or use php-mock to mock the built-in function with no code changes.
When sleep() slows PHPUnit tests, extract a Clock class and use Mockery spy to replace it, or use php-mock to mock the built-in function with no code changes.