PHPUnit - call undefined function curl_init ()
I am using PHPUnit to try and unit test some PHP files that are part of a web application that I am developing. I have a WAMP server configured and I have a php.ini file installed to install the curl extension. I tested it by setting the phpinfo () check and curl has a config section on the page indicating that it is installed.
When I run the entire web application starting from the index page, this php page I am trying to check finds the curl_init () function without issue.
However, when I run my unit test file on a file, it throws the following error:
PHP Fatal error: Call to undefined function curl_init() in ...
As I said, the file that calls curl_init () works fine when run in the context of the whole application, but cannot find it when it is only executed in my PHPUnit tests. Does anyone know why this is happening? PHPUnit doesn't know how to find PHP extensions installed on my WAMP server?
source to share