@@ -374,17 +374,18 @@ public function testNoCurlExceptions()
374374 */
375375 public function testCurlException ()
376376 {
377+ if (function_exists ('curl_init ' )) {
378+ ParseClient::setHttpClient (new ParseCurlHttpClient ());
377379
378- ParseClient::setHttpClient (new ParseCurlHttpClient ());
379-
380- $ this ->setExpectedException ('\Parse\ParseException ' , '' , 6 );
380+ $ this ->setExpectedException ('\Parse\ParseException ' , '' , 6 );
381381
382- ParseClient::setServerURL ('http://404.example.com ' , 'parse ' );
383- ParseClient::_request (
384- 'GET ' ,
385- 'not-a-real-endpoint-to-reach ' ,
386- null
387- );
382+ ParseClient::setServerURL ('http://404.example.com ' , 'parse ' );
383+ ParseClient::_request (
384+ 'GET ' ,
385+ 'not-a-real-endpoint-to-reach ' ,
386+ null
387+ );
388+ }
388389 }
389390
390391 /**
@@ -436,19 +437,21 @@ public function testBadStreamRequest()
436437 */
437438 public function testCurlBadRequest ()
438439 {
439- $ this ->setExpectedException (
440- '\Parse\ParseException ' ,
441- "Bad Request "
442- );
443-
444- ParseClient::setHttpClient (new ParseCurlHttpClient ());
445-
446- ParseClient::setServerURL ('http://example.com ' , '/ ' );
447- ParseClient::_request (
448- 'GET ' ,
449- '' ,
450- null
451- );
440+ if (function_exists ('curl_init ' )) {
441+ $ this ->setExpectedException (
442+ '\Parse\ParseException ' ,
443+ "Bad Request "
444+ );
445+
446+ ParseClient::setHttpClient (new ParseCurlHttpClient ());
447+
448+ ParseClient::setServerURL ('http://example.com ' , '/ ' );
449+ ParseClient::_request (
450+ 'GET ' ,
451+ '' ,
452+ null
453+ );
454+ }
452455 }
453456
454457 /**
@@ -476,23 +479,25 @@ public function testGetDefaultHttpClient()
476479 */
477480 public function testCurlCAFile ()
478481 {
479- // set a curl client
480- ParseClient::setHttpClient (new ParseCurlHttpClient ());
481-
482- // not a real ca file, just testing setting
483- ParseClient::setCAFile ("not-real-ca-file " );
484-
485- $ this ->setExpectedException (
486- '\Parse\ParseException ' ,
487- "Bad Request "
488- );
489-
490- ParseClient::setServerURL ('http://example.com ' , '/ ' );
491- ParseClient::_request (
492- 'GET ' ,
493- '' ,
494- null
495- );
482+ if (function_exists ('curl_init ' )) {
483+ // set a curl client
484+ ParseClient::setHttpClient (new ParseCurlHttpClient ());
485+
486+ // not a real ca file, just testing setting
487+ ParseClient::setCAFile ("not-real-ca-file " );
488+
489+ $ this ->setExpectedException (
490+ '\Parse\ParseException ' ,
491+ "Bad Request "
492+ );
493+
494+ ParseClient::setServerURL ('http://example.com ' , '/ ' );
495+ ParseClient::_request (
496+ 'GET ' ,
497+ '' ,
498+ null
499+ );
500+ }
496501 }
497502
498503 /**
0 commit comments