/** * @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()); }
/** * 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()); }