コード例 #1
0
 public function testCanInstantiateCustomeVariable()
 {
     $variable = new CustomVariable(1, 'var1', 'value1');
     $this->assertEquals(1, $variable->getIndex());
     $this->assertEquals('var1', $variable->getName());
     $this->assertEquals('value1', $variable->getValue());
     $this->assertEquals(CustomVariable::SCOPE_PAGE_LEVEL, $variable->getScope());
 }
コード例 #2
0
ファイル: Gajs.php プロジェクト: riteshkmr33/ovessnce
 protected function prepareCustomVariable(CustomVariable $customVariable)
 {
     $data = array($customVariable->getIndex(), $customVariable->getName(), $customVariable->getValue(), $customVariable->getScope());
     return $this->push('setCustomVar', $data);
 }
コード例 #3
0
ファイル: Tracker.php プロジェクト: riteshkmr33/ovessnce
 public function addCustomVariable(CustomVariable $variable)
 {
     $index = $variable->getIndex();
     if (array_key_exists($index, $this->customVariables)) {
         throw new InvalidArgumentException(sprintf('Cannot add custom variable with index %d, it already exists', $index));
     }
     $this->customVariables[$index] = $variable;
 }