public function testDeletedEntryIsNull() { $this->_entryMapper->postEntry($this->_testEntry); $entry = $this->_entryMapper->getEntry($this->_testEntry->getId()); $this->_entryMapper->deleteEntry($entry); $deletedEntry = $this->_entryMapper->getEntry($entry->getId()); $this->assertNull($deletedEntry); }
public function testDeleteActionEntryIsDeleted() { $this->_entryMapper->postEntry($this->_testEntry); $this->dispatch('/entry/delete/id/' . $this->_testEntry->getId()); $id = $this->getRequest()->getParam('id'); $deletedEntry = $this->_entryMapper->getEntry($id); $this->assertNull($deletedEntry); }
/** * Delete Action * * @return void */ public function deleteAction() { $id = $this->_getParam('id'); $this->view->headTitle()->prepend('Delete'); $entry = $this->_entryMapper->getEntry($id); if (null === $entry) { throw new Zend_Controller_Dispatcher_Exception(); } $this->_entryMapper->deleteEntry($entry); $this->_redirect($this->_router->assemble(array('action' => 'index', 'controller' => 'entry'), null, true)); }