@@ -374,17 +374,18 @@ public function testNoCurlExceptions()
374
374
*/
375
375
public function testCurlException ()
376
376
{
377
+ if (function_exists ('curl_init ' )) {
378
+ ParseClient::setHttpClient (new ParseCurlHttpClient ());
377
379
378
- ParseClient::setHttpClient (new ParseCurlHttpClient ());
379
-
380
- $ this ->setExpectedException ('\Parse\ParseException ' , '' , 6 );
380
+ $ this ->setExpectedException ('\Parse\ParseException ' , '' , 6 );
381
381
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
+ }
388
389
}
389
390
390
391
/**
@@ -436,19 +437,21 @@ public function testBadStreamRequest()
436
437
*/
437
438
public function testCurlBadRequest ()
438
439
{
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
+ }
452
455
}
453
456
454
457
/**
@@ -476,23 +479,25 @@ public function testGetDefaultHttpClient()
476
479
*/
477
480
public function testCurlCAFile ()
478
481
{
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
+ }
496
501
}
497
502
498
503
/**
0 commit comments