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); }
/** * Returns an array of Entry items for a page. * * @param integer $offset Page offset * @param integer $itemCountPerPage Number of items per page * @return array */ public function getItems($offset, $itemCountPerPage) { $entryRowset = parent::getItems($offset, $itemCountPerPage); $entries = array(); /* @var $entryRow Zend_Db_Table_Row_Abstract */ foreach ($entryRowset as $entryRow) { $entry = $this->_entryMapper->createEntryFromRow($entryRow); $entries[] = $entry; } return $entries; }
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)); }