diff --git a/tests/unit/controllers/CartTest.php b/tests/unit/controllers/CartTest.php index 7a6b033707..736d4d1097 100644 --- a/tests/unit/controllers/CartTest.php +++ b/tests/unit/controllers/CartTest.php @@ -527,8 +527,9 @@ public function testSetAddressesOnCart(string $whichAddress = 'shipping', bool $ } $this->request->setBodyParams($bodyParams); - $originalSettingValue = Plugin::getInstance()->getSettings()->autoSetNewCartAddresses; - Plugin::getInstance()->getSettings()->autoSetNewCartAddresses = false; + $primaryStore = Plugin::getInstance()->getStores()->getPrimaryStore(); + $originalSettingValue = $primaryStore->getAutoSetNewCartAddresses(false); + $primaryStore->setAutoSetNewCartAddresses(false); $this->cartController->runAction('update-cart'); @@ -589,7 +590,7 @@ public function testSetAddressesOnCart(string $whichAddress = 'shipping', bool $ Craft::$app->getElements()->deleteElement($cart, true); - Plugin::getInstance()->getSettings()->autoSetNewCartAddresses = $originalSettingValue; + $primaryStore->setAutoSetNewCartAddresses($originalSettingValue); } /**