Esempio n. 1
0
 public function testDeleteInvalidId()
 {
     $gateway = $this->getTableGateway();
     $event = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $mapper = new TagMapper($event, $gateway);
     $tag = new StoredTag();
     $tag->setTagId(1000000);
     $result = $mapper->delete($tag);
     $this->assertFalse($result);
     $this->assertEquals(1000000, $tag->getTagId());
 }
Esempio n. 2
0
 /**
  *  Remove a tag
  *
  *  @access public
  *  @return boolean the result true if removed
  *  @param QuickTag\Model\StoredTag $tag
  *  @throws QuickTag\QuickTagException if database operation fails
  */
 public function removeTag(StoredTag $tag)
 {
     $result = $this->mapper->delete($tag);
     $this->event->dispatch(TagEventsMap::REMOVE, new TagRemoveEvent($result, $tag));
     return $result;
 }