/**
  * test delete
  *
  * @return void
  */
 public function testDelete()
 {
     $conn = $this->conn;
     $query = $this->query;
     $repo = new Repository($conn);
     $query->shouldReceive('where')->andReturn($query);
     $query->shouldReceive('delete');
     $repo->delete('name', 'option', 'targetId', 'userId');
 }
Example #2
0
 /**
  * remove counter log
  *
  * @param string                $targetId targetId
  * @param MemberEntityInterface $author   user instance
  * @return void
  */
 public function remove($targetId, MemberEntityInterface $author = null)
 {
     $author = $this->getUser($author);
     if ($this->isSession() === true) {
         $this->session->remove($targetId);
     }
     if ($author->getId() != '') {
         $this->repo->delete($this->name, $this->option, $targetId, $author->getId());
     }
 }