I have a function that makes HTTP requests with cURL, which returns to file_get_contents() if cURL is not available on the system.
I would like to write unit tests for this function (using PHPUnit), where cURL is available for some tests and not available for others.
Is it possible to programmatically disable PHP functions such as curl_init() ?
I know that I can use the disable_functions parameter in php.ini, but I was hoping to find a way to conduct unit tests without reconfiguring PHP between runs.
source share