|
@@ -45,10 +45,11 @@ class WebserviceMock extends Webservice
|
|
* @param string $url
|
|
* @param string $url
|
|
* @param string $method
|
|
* @param string $method
|
|
* @param array $data
|
|
* @param array $data
|
|
|
|
+ * @param int $timeout
|
|
*
|
|
*
|
|
* @return HttpResponse
|
|
* @return HttpResponse
|
|
*/
|
|
*/
|
|
- public function makeRequest($url, $method = HttpRequestInterface::METHOD_GET, $data = array())
|
|
|
|
|
|
+ public function makeRequest($url, $method = HttpRequestInterface::METHOD_GET, $data = array(), $timeout = 60)
|
|
{
|
|
{
|
|
// $request = new HttpRequest($method, $url);
|
|
// $request = new HttpRequest($method, $url);
|
|
// $headers = array();
|
|
// $headers = array();
|
|
@@ -70,10 +71,11 @@ class WebserviceMock extends Webservice
|
|
* @param array $data
|
|
* @param array $data
|
|
* @param array $credentials
|
|
* @param array $credentials
|
|
* @param array $cookies
|
|
* @param array $cookies
|
|
|
|
+ * @param int $timeout
|
|
*
|
|
*
|
|
* @return HttpResponse
|
|
* @return HttpResponse
|
|
*/
|
|
*/
|
|
- public function makeGetRequest($url, $method = HttpRequestInterface::METHOD_GET, $data = array(), $credentials = array(), $cookies = array())
|
|
|
|
|
|
+ public function makeGetRequest($url, $method = HttpRequestInterface::METHOD_GET, $data = array(), $credentials = array(), $cookies = array(), $timeout = 60)
|
|
{
|
|
{
|
|
$response = '';
|
|
$response = '';
|
|
foreach ((array)$this->dataResponse as $k => $v) {
|
|
foreach ((array)$this->dataResponse as $k => $v) {
|
|
@@ -84,11 +86,11 @@ class WebserviceMock extends Webservice
|
|
if (($key != null && strpos($url, $key) !== false) ||
|
|
if (($key != null && strpos($url, $key) !== false) ||
|
|
strpos($url, $k) !== false) {
|
|
strpos($url, $k) !== false) {
|
|
$response = $v;
|
|
$response = $v;
|
|
-
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
|
|
|