/**
  * test set config
  *
  * @return void
  */
 public function testSet()
 {
     $configManager = $this->configManager;
     $configHandler = new ConfigHandler($configManager);
     $configEntity = $this->getConfigEntity();
     $configManager->shouldReceive('get')->andReturn($configEntity);
     $configEntity->shouldReceive('set');
     $configEntity->shouldReceive('getPureAll')->andReturn([]);
     $configManager->shouldReceive('put');
     $configHandler->set('id-counter');
 }
示例#2
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;
 }