2020 */
2121
2222namespace ZendTest \Http \Client ;
23+
24+ use Zend \Config \Config ;
2325use Zend \Http \Client \Adapter ;
2426
2527/**
@@ -56,14 +58,25 @@ class CurlTest extends CommonHttpTests
5658
5759 protected function setUp ()
5860 {
59- $ this ->markTestIncomplete ('cURL implementation incomplete at the moment ' );
60-
6161 if (!extension_loaded ('curl ' )) {
6262 $ this ->markTestSkipped ('cURL is not installed, marking all Http Client Curl Adapter tests skipped. ' );
6363 }
6464 parent ::setUp ();
6565 }
6666
67+ public function testSimpleRequests ()
68+ {
69+ $ this ->markTestSkipped ('Method PATCH not implemented. ' );
70+ }
71+
72+ /**
73+ * @dataProvider parameterArrayProvider
74+ */
75+ public function testPatchData ($ params )
76+ {
77+ $ this ->markTestSkipped ('Method PATCH not implemented. ' );
78+ }
79+
6780 /**
6881 * Off-line common adapter tests
6982 */
@@ -95,7 +108,7 @@ public function testConfigSetAsArray()
95108 public function testConfigSetAsZendConfig ()
96109 {
97110
98- $ config = new \ Zend \ Config \ Config (array (
111+ $ config = new Config (array (
99112 'timeout ' => 400 ,
100113 'nested ' => array (
101114 'item ' => 'value ' ,
@@ -118,7 +131,7 @@ public function testSetConfigInvalidConfig($config)
118131 {
119132 $ this ->setExpectedException (
120133 'Zend\Http\Client\Adapter\Exception\InvalidArgumentException ' ,
121- 'Array or Zend\Config\Config object expected ' );
134+ 'Array or Traversable object expected ' );
122135
123136 $ this ->_adapter ->setOptions ($ config );
124137 }
@@ -172,10 +185,6 @@ public function testRedirectWithGetOnly()
172185 */
173186 public function testRedirectPostToGetWithCurlFollowLocationOptionLeadsToTimeout ()
174187 {
175- $ this ->setExpectedException (
176- 'Zend\Http\Client\Adapter\Exception\RuntimeException ' ,
177- 'Error in cURL request: Operation timed out after 1000 milliseconds with 0 bytes received ' );
178-
179188 $ adapter = new Adapter \Curl ();
180189 $ this ->client ->setAdapter ($ adapter );
181190 $ adapter ->setOptions (array (
@@ -191,6 +200,9 @@ public function testRedirectPostToGetWithCurlFollowLocationOptionLeadsToTimeout(
191200 $ this ->client ->setParameterGet (array ('swallow ' => 'african ' ));
192201 $ this ->client ->setParameterPost (array ('Camelot ' => 'A silly place ' ));
193202 $ this ->client ->setMethod ('POST ' );
203+ $ this ->setExpectedException (
204+ 'Zend\Http\Client\Adapter\Exception\RuntimeException ' ,
205+ 'Error in cURL request: Operation timed out after 1000 milliseconds with 0 bytes received ' );
194206 $ this ->client ->send ();
195207 }
196208
@@ -239,17 +251,16 @@ public function testPutFileHandleWithHttpClient()
239251
240252 public function testWritingAndNotConnectedWithCurlHandleThrowsException ()
241253 {
242- $ this ->setExpectedException ('Zend\Http\Client\Adapter\Exception ' , "Trying to write but we are not connected " );
243-
244254 $ adapter = new Adapter \Curl ();
255+ $ this ->setExpectedException ('Zend\Http\Client\Adapter\Exception\RuntimeException ' ,
256+ 'Trying to write but we are not connected ' );
245257 $ adapter ->write ("GET " , "someUri " );
246258 }
247259
248260 public function testSetConfigIsNotArray ()
249261 {
250- $ this ->setExpectedException ('Zend\Http\Client\Adapter\Exception ' );
251-
252262 $ adapter = new Adapter \Curl ();
263+ $ this ->setExpectedException ('Zend\Http\Client\Adapter\Exception\InvalidArgumentException ' );
253264 $ adapter ->setOptions ("foo " );
254265 }
255266
@@ -300,7 +311,7 @@ public function testGetCurlHandle()
300311
301312 $ this ->assertTrue (is_resource ($ adapter ->getHandle ()));
302313 }
303-
314+
304315 /**
305316 * @group ZF-9857
306317 */
0 commit comments