예제 #1
0
 /**
  * Discard applied attribute records
  *
  * @param array[] $data
  * @param string $key
  * @param EcomDev_PHPUnit_Model_FixtureInterface $fixture
  *
  * @return EcomDev_PHPUnit_Model_Fixture_Processor_Attributes
  */
 public function discard(array $data, $key, EcomDev_PHPUnit_Model_FixtureInterface $fixture)
 {
     $ignoreCleanUp = array();
     // Ignore cleaning of entities if shared fixture loaded something for them
     if ($fixture->isScopeLocal() && $fixture->getStorageData(self::STORAGE_KEY, EcomDev_PHPUnit_Model_FixtureInterface::SCOPE_SHARED)) {
         $ignoreCleanUp = $fixture->getStorageData(self::STORAGE_KEY, EcomDev_PHPUnit_Model_FixtureInterface::SCOPE_SHARED);
     }
     $this->getResource()->beginTransaction();
     foreach (array_keys($data) as $entityType) {
         if (in_array($entityType, $ignoreCleanUp)) {
             continue;
         }
         $this->_getAttributeLoader($entityType)->cleanAttributes($entityType, $data);
     }
     $this->getResource()->commit();
     EcomDev_PHPUnit_Test_Case_Util::replaceRegistry('_singleton/eav/config', null);
     //clean out the EAV cache
     return $this;
 }
예제 #2
0
 /**
  * Replaces value in Magento system registry
  *
  * @param string $key
  * @param mixed $value
  * @return EcomDev_PHPUnit_Test_Case
  */
 protected function replaceRegistry($key, $value)
 {
     TestUtil::replaceRegistry($key, $value);
     return $this;
 }