Exemplo n.º 1
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());
     }
 }
 /**
  * test add, 등록된 target_id 를 삭제
  *
  * @return void
  */
 public function testRemoveExistsSession()
 {
     $session = $this->session;
     $counter = new SessionCounter($session);
     $counter->init('id-session', 'default');
     // add to not exists session
     $session->shouldReceive('get')->andReturn(['id-session' => ['targetId']]);
     $session->shouldReceive('set');
     $counter->remove('targetId');
 }