public function testDeleteDocument() { $data = (object) array('_id' => 'fooBar', '_rev' => '1-3491449E1G4S91S648S7E49FE', 'foo' => 'bar', 'boo' => 'bar'); $doc = new Document($data, $this->mockClient, 'client_test1'); $this->mockClient->expects($this->any())->method('deleteDocument')->will($this->returnValue(null)); $doc->delete(); $this->setExpectedException('Klinai\\Model\\Exception\\DocumentIsMarkedAsDeletedException'); $doc->record(); }
/** * * @deprecated * @codeCoverageIgnore */ public function storeDocByArray($databaseName, $docData) { if (!$docData instanceof \stdClass && !is_array($docData)) { throw new RuntimeException("doc is not a instance of (Document or stdClass or Array)"); } $doc = new Document($docData, $this, $databaseName); $doc->record(); return $doc; }