Ejemplo n.º 1
0
 /**
  * @testdox deduplicate() marks the value as deduplicated if the use count is 2
  */
 public function testDeduplicateTrue()
 {
     $configValue = new ConfigValue([], 'foo');
     $configValue->incrementUseCount();
     $configValue->incrementUseCount();
     $configValue->deduplicate();
     $this->assertTrue($configValue->isDeduplicated());
 }
Ejemplo n.º 2
0
 /**
  * Encode a ConfigValue instance into JavaScript
  *
  * @param  ConfigValue $configValue
  * @return string
  */
 protected function encodeConfigValue(ConfigValue $configValue)
 {
     return $configValue->isDeduplicated() ? $configValue->getVarName() : $this->encode($configValue->getValue());
 }