@@ -28,8 +28,9 @@ class IoTest extends BaseTest
2828
2929 public function testExecutorSelection ()
3030 {
31+ $ default = function_exists ('curl_version ' ) ? 'Google_IO_Curl ' : 'Google_IO_Stream ' ;
3132 $ client = $ this ->getClient ();
32- $ this ->assertInstanceOf (' Google_IO_Curl ' , $ client ->getIo ());
33+ $ this ->assertInstanceOf ($ default , $ client ->getIo ());
3334 $ config = new Google_Config ();
3435 $ config ->setIoClass ('Google_IO_Stream ' );
3536 $ client = new Google_Client ($ config );
@@ -80,32 +81,47 @@ public function testStreamInvalidRequest()
8081
8182 public function testCurlSetTimeout ()
8283 {
84+ if (!function_exists ('curl_version ' )) {
85+ $ this ->markTestSkipped ('cURL not present ' );
86+ }
8387 $ io = new Google_IO_Curl ($ this ->getClient ());
8488 $ this ->timeoutChecker ($ io );
8589 }
8690
8791 public function testCurlParseHttpResponseBody ()
8892 {
93+ if (!function_exists ('curl_version ' )) {
94+ $ this ->markTestSkipped ('cURL not present ' );
95+ }
8996 $ io = new Google_IO_Curl ($ this ->getClient ());
9097 $ this ->responseChecker ($ io );
9198 }
9299
93100 public function testCurlProcessEntityRequest ()
94101 {
102+ if (!function_exists ('curl_version ' )) {
103+ $ this ->markTestSkipped ('cURL not present ' );
104+ }
95105 $ client = $ this ->getClient ();
96106 $ io = new Google_IO_Curl ($ client );
97107 $ this ->processEntityRequest ($ io , $ client );
98108 }
99109
100110 public function testCurlCacheHit ()
101111 {
112+ if (!function_exists ('curl_version ' )) {
113+ $ this ->markTestSkipped ('cURL not present ' );
114+ }
102115 $ client = $ this ->getClient ();
103116 $ io = new Google_IO_Curl ($ client );
104117 $ this ->cacheHit ($ io , $ client );
105118 }
106119
107120 public function testCurlAuthCache ()
108121 {
122+ if (!function_exists ('curl_version ' )) {
123+ $ this ->markTestSkipped ('cURL not present ' );
124+ }
109125 $ client = $ this ->getClient ();
110126 $ io = new Google_IO_Curl ($ client );
111127 $ this ->authCache ($ io , $ client );
@@ -116,6 +132,9 @@ public function testCurlAuthCache()
116132 */
117133 public function testCurlInvalidRequest ()
118134 {
135+ if (!function_exists ('curl_version ' )) {
136+ $ this ->markTestSkipped ('cURL not present ' );
137+ }
119138 $ io = new Google_IO_Curl ($ this ->getClient ());
120139 $ this ->invalidRequest ($ io );
121140 }
0 commit comments