Question

I am writing unit tests using the EcomDev PHPUnit extension. When trying to provide values to the Mage::getStoreConfig() method using a fixture, I am not getting the value from my fixture, but the default value (from XML or from DB). The fixture file has been found (I know that, because it threw errors until it was named correctly and in the right folder) and is very simple (myMethod.yaml):

config:
  payment/mymodule/numdays: 5

However in my block test in the method myMethod():

/**
* @test
* @loadFixture
*/
public function myMethod() {
//...
    Mage::getStoreConfig('payment/mymodule/numdays'); // returns 14
//...
}

Also, the store config returns 14 when it is called in the block under test.

Did I misunderstand the way to use these config value fixtures? In the backend, all cache types are turned off.

Was it helpful?

Solution

I was able to fix it by putting "default" in front of the fixture value, so the yaml looks like this:

config:
  default/payment/mymodule/numdays: 5

Comments on whether I am supposed to add this prefix are very welcome.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top