|
9 | 9 |
|
10 | 10 | $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
11 | 11 | $store = $objectManager->create(\Magento\Store\Model\Store::class);
|
12 |
| -$storeId = $store->load('fixture_second_store', 'code')->getId(); |
13 |
| -/** @var \Magento\Config\Model\ResourceModel\Config $configResource */ |
14 |
| -$configResource = $objectManager->get(\Magento\Config\Model\ResourceModel\Config::class); |
15 |
| -$configResource->saveConfig( |
16 |
| - \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_DEFAULT, |
17 |
| - 'EUR', |
18 |
| - \Magento\Store\Model\ScopeInterface::SCOPE_STORES, |
19 |
| - $storeId |
20 |
| -); |
21 |
| -$configResource->saveConfig( |
22 |
| - \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_ALLOW, |
23 |
| - 'EUR', |
24 |
| - \Magento\Store\Model\ScopeInterface::SCOPE_STORES, |
25 |
| - $storeId |
26 |
| -); |
| 12 | +if ($storeId = $store->load('fixture_second_store', 'code')->getId()) { |
| 13 | + /** @var \Magento\Config\Model\ResourceModel\Config $configResource */ |
| 14 | + $configResource = $objectManager->get(\Magento\Config\Model\ResourceModel\Config::class); |
| 15 | + $configResource->saveConfig( |
| 16 | + \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_DEFAULT, |
| 17 | + 'EUR', |
| 18 | + \Magento\Store\Model\ScopeInterface::SCOPE_STORES, |
| 19 | + $storeId |
| 20 | + ); |
| 21 | + $configResource->saveConfig( |
| 22 | + \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_ALLOW, |
| 23 | + 'EUR', |
| 24 | + \Magento\Store\Model\ScopeInterface::SCOPE_STORES, |
| 25 | + $storeId |
| 26 | + ); |
| 27 | + /** |
| 28 | + * Configuration cache clean is required to reload currency setting |
| 29 | + */ |
| 30 | + /** @var Magento\Config\App\Config\Type\System $config */ |
| 31 | + $config = $objectManager->get(\Magento\Config\App\Config\Type\System::class); |
| 32 | + $config->clean(); |
| 33 | +} |
27 | 34 |
|
28 |
| -/** |
29 |
| - * Configuration cache clean is required to reload currency setting |
30 |
| - */ |
31 |
| -/** @var Magento\Config\App\Config\Type\System $config */ |
32 |
| -$config = $objectManager->get(\Magento\Config\App\Config\Type\System::class); |
33 |
| -$config->clean(); |
34 | 35 |
|
35 | 36 | /** @var \Magento\Directory\Model\ResourceModel\Currency $rate */
|
36 | 37 | $rate = $objectManager->create(\Magento\Directory\Model\ResourceModel\Currency::class);
|
|
0 commit comments