tests++
[m6w6/ext-http] / phpunit / DataShareTest.php
index 0a5072780f5c9f26843defce1c2b95a63c63ffad..f4a0453c6163c1d968b7ec5c5650774a879a08a5 100644 (file)
@@ -1,5 +1,11 @@
 <?php
 
+class UserClient extends http\Client\AbstractClient {
+       function send($request = null) {
+       }
+}
+       
+
 class DataShareTest extends PHPUnit_Framework_TestCase
 {
     function testStandard() {
@@ -54,5 +60,16 @@ class DataShareTest extends PHPUnit_Framework_TestCase
        $share->detach($client);
        $share->reset();
     }
+    
+    function testCurlIncompatible() {
+       $client = new UserClient;
+       $client->setRequest(new http\Client\Request("GET", "https://twitter.com"));
+
+       $share = new http\Curl\Client\DataShare;
+               $this->setExpectedException("PHPUnit_Framework_Error_Warning");
+       $share->attach($client);
+               $this->setExpectedException("PHPUnit_Framework_Error_Warning");
+       $share->detach($client);
+    }
 }