Exemple #1
0
 /**
  * @covers Paradox\pod\Document::toTransactionJSON
  */
 public function testToTransactionJSON()
 {
     $this->document->setId('mycollection/123456');
     $this->document->setRevision('myrevision');
     $this->document->set('mykey', 'myvalue');
     $converted = $this->document->toTransactionJSON();
     $decoded = json_decode($converted);
     $this->assertFalse(isset($decoded->_id), "The converted document should not have an id");
     $this->assertFalse(isset($decoded->_key), "The converted document should not have a key");
     $this->assertEquals('myrevision', $decoded->_rev, "The converted document's revision does not match");
     $this->assertEquals('myvalue', $decoded->mykey, "The converted document's data does not match");
 }