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);
 }
Exemple #3
0
 /**
  * Is Identical To
  *
  * @param Postr_Model_Entry $entry
  * @return boolean
  */
 public function isIdenticalTo(Postr_Model_Entry $entry)
 {
     return $this->getId() == $entry->getId();
 }
Exemple #4
0
 public function testSetAndGetId()
 {
     $value = 371;
     $this->_entry->setId($value);
     $this->assertEquals($value, $this->_entry->getId());
 }
Exemple #5
0
 /**
  * Delete Entry
  *
  * @param Postr_Model_Entry $entry
  * @return Postr_Model_EntryMapper          Provides a fluent interface
  */
 public function deleteEntry(Postr_Model_Entry $entry)
 {
     $dbAdapter = $this->_entryTable->getAdapter();
     $dbAdapter->beginTransaction();
     $entryRow = $this->_entryTable->find($entry->getId())->current();
     $entryRow->delete();
     $dbAdapter->commit();
     return $this;
 }