Open
Description
Summary (*)
Creating a store inside integration tests doesn't work if there is a plugin defined for Magento\Framework\App\Config
.
I have a test that requires a new store and it is not possible to save it. There is an exception "Property data does not exist".
When saving a store, method \Magento\TestFramework\Store\StoreManager::reinitStores
is called, the reflection class will only have properties from the Interceptor
class and not \Magento\TestFramework\App\Config
.
PHP: 7.0
Magento: 2.2.6
Examples (*)
Create a plugin for Config, doesn't matter what it does:
<type name="Magento\Framework\App\Config">
<plugin name="some_plugin" type="Some\Vendor\Plugin\FrameworkAppConfig" />
</type>
Have an integration test that creates a new store:
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(\Magento\Store\Model\Store::class)->create();
$store->setCode('new_store)->setWebsiteId(1)->setGroupId(1)->setName('New store')->setIsActive(true);
\Magento\TestFramework\Helper\Bootstrap::getObjectManager(\Magento\Store\Model\ResourceModel\Store::class)->save($store);
Proposed solution
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.The issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 releaseMajor restrictions or short-term circumventions are required until a fix is available.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Pull Request In Progress