clevis/utils-functions-proxy

简单的可模拟的函数调用代理。

dev-master 2013-08-28 19:06 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:19:48 UTC


README

用法

/** @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();

原因

因为与内置函数不同,这个代理可以在测试中进行模拟。