clevis / utils-functions-proxy
Simple proxy to function calls that can be mocked.
dev-master
2013-08-28 19:06 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-12-17 04:31:54 UTC
README
Usage
/** @var ICurlProxy $curl */
$curl = new FunctionsProxy('curl_');
$handle = $curl->init();
$curl->setopt($handle, CURLOPT_URL, 'example.com');
$curl->setopt($handle, CURLOPT_RETURNTRANSFER, 1);
$response = $curl->exec($handle);
$curl->close();
Why
Because unlike built-in functions, this proxy could be mocked in tests.