Exemplo n.º 1
0
 /**
  * counter 설정
  *
  * @param string $name   counter name
  * @param string $option counter option
  * @return Counter
  */
 public function init($name, $option = 'default')
 {
     $this->name = $name;
     $this->option = $option;
     $this->type = $this->configHandler->getType($name);
     if ($this->isSession()) {
         $this->session->init($name, $option);
     }
     return $this;
 }
 /**
  * test not invoked
  *
  * @return void
  */
 public function testNotInvoked()
 {
     $session = $this->session;
     $counter = new SessionCounter($session);
     $counter->init('id-session', 'default');
     $session->shouldReceive('get')->andReturn(['id-session' => []]);
     $result = $counter->invoked('targetId');
     $this->assertFalse($result);
 }