Skip to content

Commit bf40eca

Browse files
committed
MC-21491: Pricing :: FPT display settings
- fix test
1 parent 05dacc6 commit bf40eca

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ class ProductViewTest extends GraphQlAbstract
3838
/** @var \Magento\Tax\Model\Calculation\Rule[] */
3939
private $fixtureTaxRules;
4040

41+
/** @var string */
42+
private $defaultRegionSystemSetting;
43+
44+
45+
/** @var string */
46+
private $defaultPriceDisplayType;
47+
4148
/**
4249
* @var StoreManagerInterface
4350
*/
@@ -52,26 +59,36 @@ protected function setUp()
5259
/** @var \Magento\Config\Model\ResourceModel\Config $config */
5360
$config = $this->objectManager->get(\Magento\Config\Model\ResourceModel\Config::class);
5461

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+
5573
//default state tax calculation AL
5674
$config->saveConfig(
5775
Config::CONFIG_XML_PATH_DEFAULT_REGION,
58-
1,
59-
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
6076
1
6177
);
6278

6379
$config->saveConfig(
6480
Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE,
65-
3,
66-
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
67-
1
81+
3
6882
);
6983
$this->getFixtureTaxRates();
7084
$this->getFixtureTaxRules();
7185

7286
/** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
7387
$config = $this->objectManager->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
7488
$config->reinit();
89+
/** @var ScopeConfigInterface $scopeConfig */
90+
$scopeConfig = $this->objectManager->get(ScopeConfigInterface::class);
91+
$scopeConfig->clean();
7592
}
7693

7794
public function tearDown()
@@ -82,16 +99,12 @@ public function tearDown()
8299
//default state tax calculation AL
83100
$config->saveConfig(
84101
Config::CONFIG_XML_PATH_DEFAULT_REGION,
85-
null,
86-
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
87-
1
102+
$this->defaultRegionSystemSetting
88103
);
89104

90105
$config->saveConfig(
91106
Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE,
92-
1,
93-
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
94-
1
107+
$this->defaultPriceDisplayType
95108
);
96109
$taxRules = $this->getFixtureTaxRules();
97110
if (count($taxRules)) {
@@ -107,6 +120,10 @@ public function tearDown()
107120
/** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
108121
$config = $this->objectManager->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
109122
$config->reinit();
123+
124+
/** @var ScopeConfigInterface $scopeConfig */
125+
$scopeConfig = $this->objectManager->get(ScopeConfigInterface::class);
126+
$scopeConfig->clean();
110127
}
111128

112129
/**

0 commit comments

Comments
 (0)