renamed http\Message\Body::add() to ::addForm() because it acually adds form-data...
[m6w6/ext-http] / phpunit / MessageBodyTest.php
index eda54b0b9e416562e4ce0fc47ef585d9a73af03e..4ef4efe43814f7f2a9c0ed0018c1d5247b2b17ce 100644 (file)
@@ -29,9 +29,9 @@ class MessageBodyTest extends PHPUnit_Framework_TestCase {
         $this->assertEquals(3, $this->temp->append("yes"));
     }
 
-    function testAdd() {
+    function testAddForm() {
         $this->assertTrue( 
-            $this->temp->add(
+            $this->temp->addForm(
                 array(
                     "foo" => "bar",
                     "more" => array(
@@ -67,7 +67,7 @@ class MessageBodyTest extends PHPUnit_Framework_TestCase {
             "\r\n".
             "fuz\r\n".
             "--%x.%x\r\n".
-            "Content-Disposition: attachment; name=\"upload\"; filename=\"MessageBodyTest.php\"\r\n".
+            "Content-Disposition: form-data; name=\"upload\"; filename=\"MessageBodyTest.php\"\r\n".
             "Content-Transfer-Encoding: binary\r\n".
             "Content-Type: text/plain\r\n".
             "\r\n".
@@ -106,4 +106,8 @@ class MessageBodyTest extends PHPUnit_Framework_TestCase {
         );
         $this->assertEquals($s, (string) $this->file);
     }
+
+    function testClone() {
+        $this->assertEquals((string) $this->file, (string) clone $this->file);
+    }
 }