EcomDev / EcomDev_PHPUnit

Magento PHPUnit Integration
http://www.ecomdev.org/shop/code-testing/php-unit-test-suite.html
Open Software License 3.0
299 stars 166 forks source link

Flat and non Flat enviroment for same model #250

Open luckyraul opened 9 years ago

luckyraul commented 9 years ago

I trying to make test for function which works differently depending on product_flat status. I tried to work with fixtures:

config:
    default/catalog/frontend/flat_catalog_product: 1

and for non flat

config:
    default/catalog/frontend/flat_catalog_product: 0

The result is 0 with Mage::getStoreConfig('catalog/frontend/flat_catalog_product')

Then I created two different test files for same model and tried to resolve just by setting value via Mage::getModel('core/config')->saveConfig('catalog/frontend/flat_catalog_product', 1) like in #52 and reinitStores() in setUp() function

The result was promising but it worked only depending on last state. And if you ran reinitStores in the both files I got the session problem session_module_name(): A session is active