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
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-08 13:29:01 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.