From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- .../Zend/Gdata/TestUtility/MockHttpClient.php | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 zend/tests/Zend/Gdata/TestUtility/MockHttpClient.php (limited to 'zend/tests/Zend/Gdata/TestUtility/MockHttpClient.php') diff --git a/zend/tests/Zend/Gdata/TestUtility/MockHttpClient.php b/zend/tests/Zend/Gdata/TestUtility/MockHttpClient.php new file mode 100644 index 0000000..453da0f --- /dev/null +++ b/zend/tests/Zend/Gdata/TestUtility/MockHttpClient.php @@ -0,0 +1,81 @@ +_requests = array(); + } + + public function popRequest() + { + if (count($this->_requests)) + return array_pop($this->_requests); + else + return NULL; + } + + public function write($method, + $uri, + $http_ver = '1.1', + $headers = array(), + $body = '') + { + $request = new Test_Zend_Gdata_MockHttpClient_Request(); + $request->method = $method; + $request->uri = $uri; + $request->http_ver = $http_ver; + $request->headers = $headers; + $request->body = $body; + array_push($this->_requests, $request); + return parent::write($method, $uri, $http_ver, $headers, $body); + } +} -- cgit v1.2.3