@@ -43,6 +43,9 @@ class FacebookCurlHttpClientTest extends AbstractTestHttpClient
4343
4444 public function setUp ()
4545 {
46+ if (!extension_loaded ('curl ' )) {
47+ $ this ->markTestSkipped ('cURL must be installed to test cURL client handler. ' );
48+ }
4649 $ this ->curlMock = m::mock ('Facebook\HttpClients\FacebookCurl ' );
4750 $ this ->curlClient = new FacebookCurlHttpClient ($ this ->curlMock );
4851 }
@@ -146,15 +149,6 @@ public function testCanCloseConnection()
146149
147150 public function testIsolatesTheHeaderAndBody ()
148151 {
149- $ this ->curlMock
150- ->shouldReceive ('getinfo ' )
151- ->with (CURLINFO_HEADER_SIZE )
152- ->once ()
153- ->andReturn (strlen ($ this ->fakeRawHeader ));
154- $ this ->curlMock
155- ->shouldReceive ('version ' )
156- ->once ()
157- ->andReturn (['version_number ' => self ::CURL_VERSION_STABLE ]);
158152 $ this ->curlMock
159153 ->shouldReceive ('exec ' )
160154 ->once ()
@@ -170,15 +164,6 @@ public function testIsolatesTheHeaderAndBody()
170164 public function testProperlyHandlesProxyHeaders ()
171165 {
172166 $ rawHeader = $ this ->fakeRawProxyHeader . $ this ->fakeRawHeader ;
173- $ this ->curlMock
174- ->shouldReceive ('getinfo ' )
175- ->with (CURLINFO_HEADER_SIZE )
176- ->once ()
177- ->andReturn (mb_strlen ($ rawHeader ));
178- $ this ->curlMock
179- ->shouldReceive ('version ' )
180- ->once ()
181- ->andReturn (['version_number ' => self ::CURL_VERSION_STABLE ]);
182167 $ this ->curlMock
183168 ->shouldReceive ('exec ' )
184169 ->once ()
@@ -194,15 +179,6 @@ public function testProperlyHandlesProxyHeaders()
194179 public function testProperlyHandlesProxyHeadersWithCurlBug ()
195180 {
196181 $ rawHeader = $ this ->fakeRawProxyHeader . $ this ->fakeRawHeader ;
197- $ this ->curlMock
198- ->shouldReceive ('getinfo ' )
199- ->with (CURLINFO_HEADER_SIZE )
200- ->once ()
201- ->andReturn (mb_strlen ($ this ->fakeRawHeader )); // Mimic bug that doesn't count proxy header
202- $ this ->curlMock
203- ->shouldReceive ('version ' )
204- ->once ()
205- ->andReturn (['version_number ' => self ::CURL_VERSION_BUGGY ]);
206182 $ this ->curlMock
207183 ->shouldReceive ('exec ' )
208184 ->once ()
@@ -218,15 +194,6 @@ public function testProperlyHandlesProxyHeadersWithCurlBug()
218194 public function testProperlyHandlesProxyHeadersWithCurlBug2 ()
219195 {
220196 $ rawHeader = $ this ->fakeRawProxyHeader2 . $ this ->fakeRawHeader ;
221- $ this ->curlMock
222- ->shouldReceive ('getinfo ' )
223- ->with (CURLINFO_HEADER_SIZE )
224- ->once ()
225- ->andReturn (mb_strlen ($ this ->fakeRawHeader )); // Mimic bug that doesn't count proxy header
226- $ this ->curlMock
227- ->shouldReceive ('version ' )
228- ->once ()
229- ->andReturn (['version_number ' => self ::CURL_VERSION_BUGGY ]);
230197 $ this ->curlMock
231198 ->shouldReceive ('exec ' )
232199 ->once ()
@@ -242,15 +209,6 @@ public function testProperlyHandlesProxyHeadersWithCurlBug2()
242209 public function testProperlyHandlesRedirectHeaders ()
243210 {
244211 $ rawHeader = $ this ->fakeRawRedirectHeader . $ this ->fakeRawHeader ;
245- $ this ->curlMock
246- ->shouldReceive ('getinfo ' )
247- ->with (CURLINFO_HEADER_SIZE )
248- ->once ()
249- ->andReturn (mb_strlen ($ rawHeader ));
250- $ this ->curlMock
251- ->shouldReceive ('version ' )
252- ->once ()
253- ->andReturn (['version_number ' => self ::CURL_VERSION_STABLE ]);
254212 $ this ->curlMock
255213 ->shouldReceive ('exec ' )
256214 ->once ()
@@ -281,15 +239,6 @@ public function testCanSendNormalRequest()
281239 ->shouldReceive ('errno ' )
282240 ->once ()
283241 ->andReturn (null );
284- $ this ->curlMock
285- ->shouldReceive ('getinfo ' )
286- ->with (CURLINFO_HEADER_SIZE )
287- ->once ()
288- ->andReturn (mb_strlen ($ this ->fakeRawHeader ));
289- $ this ->curlMock
290- ->shouldReceive ('version ' )
291- ->once ()
292- ->andReturn (['version_number ' => self ::CURL_VERSION_STABLE ]);
293242 $ this ->curlMock
294243 ->shouldReceive ('close ' )
295244 ->once ()
0 commit comments