/** * Test * * @return void */ public function testRemove() { $this->assertTrue($this->object->remove('undefined-file')); }
/** * Delete file * * @return \Zend\View\Model\JsonModel */ public function removeAction() { $property = Property\Model::fromId($this->getRouteMatch()->getParam('property_id')); $document = Document\Model::fromId($this->getRouteMatch()->getParam('document_id')); if ($this->getRequest()->getMethod() != 'DELETE' or empty($document) or empty($property)) { return $this->returnJson(array('error' => true)); } $file = base64_decode($this->getRouteMatch()->getParam('file')); $fileClass = new File(); $fileClass->load($property, $document); return $this->returnJson(array($fileClass->remove($file))); }