/** * Initializes cache options * * @param EcomDev_PHPUnit_Model_FixtureInterface $fixture * @return EcomDev_PHPUnit_Model_Fixture_Processor_Cache */ public function initialize(EcomDev_PHPUnit_Model_FixtureInterface $fixture) { $options = $fixture->getOptions(); if (isset($options['cache'])) { $cacheOptions = array(); foreach ($options['cache'] as $annotation) { list($action, $cacheType) = preg_split('/\\s+/', trim($annotation)); $flag = $action === 'off' ? 0 : 1; if ($cacheType === 'all') { foreach (Mage::app()->getCacheInstance()->getTypes() as $type) { $cacheOptions[$type->getId()] = $flag; } } else { $cacheOptions[$cacheType] = $flag; } } $fixture->setFixtureValue('cache_options', $cacheOptions); } return $this; }
/** * Initializes fixture processor before applying data * * @param EcomDev_PHPUnit_Model_FixtureInterface $fixture * @return EcomDev_PHPUnit_Model_Fixture_Processor_Registry */ public function initialize(EcomDev_PHPUnit_Model_FixtureInterface $fixture) { $options = $fixture->getOptions(); $registry = array(); foreach (array('singleton', 'resource', 'helper', 'registry') as $type) { if (!isset($options[$type])) { continue; } foreach ($options[$type] as $name) { $registry[$type][] = $name; } } if ($registry) { $fixture->setFixtureValue('registry', $registry); } return $this; }