php-mock/php-mock-mockery
Integrates php-mock with Mockery to mock PHP built-in functions in tests. Create namespaced function mocks with PHPMockery::mock() and set expectations/returns, then call Mockery::close(). Supports only unqualified calls; define early if needed.
time(), file_get_contents()), especially in legacy systems lacking dependency injection.stream_get_contents()).--process-isolation)?curl_exec())?devDependencies, then update PHPUnit bootstrap to initialize mocks. Gradually replace ad-hoc function mocks in tests with php-mock-mockery syntax (e.g., Mockery::mockFunction('time')->andReturn(123)).mockery/mockery) are already used for class mocking.phpunit.xml bootstrap file) to ensure mocks are active before any test code runs. Prioritize high-risk legacy modules first (e.g., date/time-dependent logic).How can I help you explore Laravel packages today?