public function testGetAttachmentFaild() { $this->setExpectedException('Klinai\\Model\\Exception\\AttachmentIsNotExistsException'); $docData = json_decode('{ "_id": "fooBar", "_rev": "1-7182e53ce7cd148307e40521e9ede288", "foo" : "dummy", "boo" : "dummy", "_attachments": { "attachment1": { "content_type": "text/plain", "revpos": 11, "digest": "md5-ezhD8uRb10w4JpIqaH8R+A==", "length": 125664, "stub": true } } }', false); /* @var $doc \Klinai\Model\Document */ $doc = new Document($docData, $this->mockClient, 'client_test1'); $attachment = $doc->getAttachment('notExistsAttachment'); }