mercredi 25 février 2015

Magento extension development - testing multiple config.xml files - values being cached?

I am writing a test framework for a Magento extension I'm building. The extension has a lot of configuration values stored in etc/config.xml under <global><default>. The test framework instantiates an extension model and runs one of its methods. However, first it copies a config.xml file to /etc/config.xml. The idea is that the model is instantiated with a different config.xml every time, to test various configurations. The test framework loops through half a dozen different config.xml files.


The problem - even if I re-bootstrap Magento, the extension model always instantiates with the config.xml data from whatever file was present when the routine was started. I can see that the etc/config.xml file is indeed being changed on every iteration, and that the changes are showing up if I dump Mage::getConfig() on each iteration. It's like the extension is caching its config values on a per-run basis. I'm executing the test file via PHP CLI.


Does anyone have any ideas on this one? I'm stumped. Thanks for reading.


Aucun commentaire:

Enregistrer un commentaire