Skip to content

Commit a2a03e0

Browse files
committed
Really truly clear config cache on discard fixtures
We found that config fixtures are still retained in memory between tests. This fixed that.
1 parent 1cd444f commit a2a03e0

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

  • app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor

app/code/community/EcomDev/PHPUnit/Model/Fixture/Processor/Config.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ protected function _restoreConfig()
139139
{
140140
Mage::getConfig()->loadScopeSnapshot();
141141
Mage::getConfig()->loadDb();
142+
143+
// Flush website and store configuration caches
144+
foreach (Mage::app()->getWebsites(true) as $website) {
145+
EcomDev_Utils_Reflection::setRestrictedPropertyValue(
146+
$website, '_configCache', array()
147+
);
148+
}
149+
foreach (Mage::app()->getStores(true) as $store) {
150+
EcomDev_Utils_Reflection::setRestrictedPropertyValue(
151+
$store, '_configCache', array()
152+
);
153+
}
154+
142155
return $this;
143156
}
144157

@@ -165,4 +178,4 @@ protected function _setConfigNodeValue($path, $value)
165178
}
166179

167180

168-
}
181+
}

0 commit comments

Comments
 (0)