/** * @covers Paradox\pod\Document::toJSON */ public function testToJSON() { $this->document->setId('mycollection/123456'); $this->document->setRevision('myrevision'); $this->document->set('mykey', 'myvalue'); $converted = $this->document->toJSON(); $decoded = json_decode($converted); $this->assertEquals('mycollection/123456', $decoded->_id, "The converted document's id does not match"); $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"); }