@@ -38,6 +38,13 @@ class ProductViewTest extends GraphQlAbstract
38
38
/** @var \Magento\Tax\Model\Calculation\Rule[] */
39
39
private $ fixtureTaxRules ;
40
40
41
+ /** @var string */
42
+ private $ defaultRegionSystemSetting ;
43
+
44
+
45
+ /** @var string */
46
+ private $ defaultPriceDisplayType ;
47
+
41
48
/**
42
49
* @var StoreManagerInterface
43
50
*/
@@ -52,26 +59,36 @@ protected function setUp()
52
59
/** @var \Magento\Config\Model\ResourceModel\Config $config */
53
60
$ config = $ this ->objectManager ->get (\Magento \Config \Model \ResourceModel \Config::class);
54
61
62
+ /** @var ScopeConfigInterface $scopeConfig */
63
+ $ scopeConfig = $ this ->objectManager ->get (ScopeConfigInterface::class);
64
+
65
+ $ this ->defaultRegionSystemSetting = $ scopeConfig ->getValue (
66
+ Config::CONFIG_XML_PATH_DEFAULT_REGION
67
+ );
68
+
69
+ $ this ->defaultPriceDisplayType = $ scopeConfig ->getValue (
70
+ Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE
71
+ );
72
+
55
73
//default state tax calculation AL
56
74
$ config ->saveConfig (
57
75
Config::CONFIG_XML_PATH_DEFAULT_REGION ,
58
- 1 ,
59
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
60
76
1
61
77
);
62
78
63
79
$ config ->saveConfig (
64
80
Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE ,
65
- 3 ,
66
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
67
- 1
81
+ 3
68
82
);
69
83
$ this ->getFixtureTaxRates ();
70
84
$ this ->getFixtureTaxRules ();
71
85
72
86
/** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
73
87
$ config = $ this ->objectManager ->get (\Magento \Framework \App \Config \ReinitableConfigInterface::class);
74
88
$ config ->reinit ();
89
+ /** @var ScopeConfigInterface $scopeConfig */
90
+ $ scopeConfig = $ this ->objectManager ->get (ScopeConfigInterface::class);
91
+ $ scopeConfig ->clean ();
75
92
}
76
93
77
94
public function tearDown ()
@@ -82,16 +99,12 @@ public function tearDown()
82
99
//default state tax calculation AL
83
100
$ config ->saveConfig (
84
101
Config::CONFIG_XML_PATH_DEFAULT_REGION ,
85
- null ,
86
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
87
- 1
102
+ $ this ->defaultRegionSystemSetting
88
103
);
89
104
90
105
$ config ->saveConfig (
91
106
Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE ,
92
- 1 ,
93
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
94
- 1
107
+ $ this ->defaultPriceDisplayType
95
108
);
96
109
$ taxRules = $ this ->getFixtureTaxRules ();
97
110
if (count ($ taxRules )) {
@@ -107,6 +120,10 @@ public function tearDown()
107
120
/** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
108
121
$ config = $ this ->objectManager ->get (\Magento \Framework \App \Config \ReinitableConfigInterface::class);
109
122
$ config ->reinit ();
123
+
124
+ /** @var ScopeConfigInterface $scopeConfig */
125
+ $ scopeConfig = $ this ->objectManager ->get (ScopeConfigInterface::class);
126
+ $ scopeConfig ->clean ();
110
127
}
111
128
112
129
/**
0 commit comments