function test_preCompile() { $oPlugin = new Plugins_DeliveryLimitations_CommaSeparatedData(); $this->assertEqual('ab,cd,ef,gh', $oPlugin->_preCompile('ab,cd,ef,gh')); $this->assertEqual('ab,cd,ef,gh', $oPlugin->_preCompile('aB,cD, ef,gh ')); $this->assertEqual('a\\b,cd,ef,gh', $oPlugin->_preCompile('a\\b,cd,ef,gh')); }
function _preCompile($sData) { $aContinentCodes = MAX_limitationsGetAFromS($sData); $aCountries = array(); foreach ($aContinentCodes as $continentCode) { $aContinentCountries = $this->res[$continentCode]; unset($aContinentCountries[0]); // Remove the name of the continent $aCountries = array_merge($aCountries, $aContinentCountries); } return parent::_preCompile(MAX_limitationsGetSFromA($aCountries)); }