Browse files

Quick check to make sure we're not running into the cURL post fields …

…appending bug.
  • Loading branch information...
1 parent 7e240b7 commit a45923db0bb7dbbfaf0046e802487c9dd7d84b26 @sbisbee committed Nov 5, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 tests/SagTest.php
View
20 tests/SagTest.php
@@ -118,6 +118,26 @@ public function test_newDocInvalidType()
}
}
+ public function test_twoPosts() {
+ $docs = array(
+ array("one" => "bwah"),
+ array("two" => "bwah")
+ );
+
+ $this->assertTrue($this->couch->post($docs[0])->body->ok);
+
+ $resp = $this->couch->post($docs[1]);
+ $this->assertTrue($resp->body->ok);
+
+ /*
+ * Make sure the fields didn't get appended:
+ * http://uk3.php.net/manual/en/function.curl-setopt-array.php#104369
+ */
+ $resp = $this->couch->get($resp->body->id);
+ $this->assertEquals($resp->body->two, $docs[1]['two']);
+ $this->assertNotEquals($resp->body->one, $docs[0]['one']);
+ }
+
public function test_getID()
{
$result = $this->couch->get('/1');

0 comments on commit a45923d

Please sign in to comment.