File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
dev/tests/integration/testsuite/Magento/Store/_files Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ require_once 'second_store.php ' ;
9
+
10
+ $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
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
+ );
27
+
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
+ /** @var \Magento\Directory\Model\ResourceModel\Currency $rate */
36
+ $ rate = $ objectManager ->create (\Magento \Directory \Model \ResourceModel \Currency::class);
37
+ $ rate ->saveRates (
38
+ [
39
+ 'USD ' => ['EUR ' => 2 ],
40
+ 'EUR ' => ['USD ' => 0.5 ]
41
+ ]
42
+ );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
9
+ $ store = $ objectManager ->create (\Magento \Store \Model \Store::class);
10
+ $ storeId = $ store ->load ('fixture_second_store ' , 'code ' )->getId ();
11
+
12
+ if ($ storeId ) {
13
+ $ configResource = $ objectManager ->get (\Magento \Config \Model \ResourceModel \Config::class);
14
+ $ configResource ->deleteConfig (
15
+ \Magento \Directory \Model \Currency::XML_PATH_CURRENCY_DEFAULT ,
16
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORES ,
17
+ $ storeId
18
+ );
19
+ $ configResource ->deleteConfig (
20
+ \Magento \Directory \Model \Currency::XML_PATH_CURRENCY_ALLOW ,
21
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORES ,
22
+ $ storeId
23
+ );
24
+ }
25
+
26
+ require_once 'second_store_rollback.php ' ;
You can’t perform that action at this time.
0 commit comments