library utils-functions-proxy
Simple proxy to function calls that can be mocked.
clevis/utils-functions-proxy
Simple proxy to function calls that can be mocked.
- Wednesday, August 28, 2013
- by roboclevis
- Repository
- 8 Watchers
- 1 Stars
- 4 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Functions Proxy
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., (*1)
dev-master
9999999-dev
Simple proxy to function calls that can be mocked.
Sources
Download
MIT
The Requires