Skip to content

Commit

Permalink
Fix cart test
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Jan 22, 2025
1 parent ab54925 commit 385b8e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/controllers/CartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 385b8e1

Please sign in to comment.