|
51 | 51 | use Commercetools\Core\Request\Carts\Command\CartChangeCustomLineItemMoneyAction; |
52 | 52 | use Commercetools\Core\Request\Carts\Command\CartChangeCustomLineItemQuantityAction; |
53 | 53 | use Commercetools\Core\Request\Carts\Command\CartChangeLineItemQuantityAction; |
| 54 | +use Commercetools\Core\Request\Carts\Command\CartChangeTaxCalculationModeAction; |
54 | 55 | use Commercetools\Core\Request\Carts\Command\CartChangeTaxRoundingModeAction; |
55 | 56 | use Commercetools\Core\Request\Carts\Command\CartRecalculateAction; |
56 | 57 | use Commercetools\Core\Request\Carts\Command\CartRemoveCustomLineItemAction; |
@@ -1432,6 +1433,34 @@ public function testCreateWithTaxRoundingMode() |
1432 | 1433 | $this->assertSame(Cart::TAX_ROUNDING_MODE_HALF_DOWN, $cart->getTaxRoundingMode()); |
1433 | 1434 | } |
1434 | 1435 |
|
| 1436 | + public function testTaxCalculationModeUnitPrice() |
| 1437 | + { |
| 1438 | + $draft = $this->getDraft(); |
| 1439 | + $cart = $this->createCart($draft); |
| 1440 | + |
| 1441 | + $this->assertSame(Cart::TAX_CALCULATION_MODE_LINE_ITEM_LEVEL, $cart->getTaxCalculationMode()); |
| 1442 | + |
| 1443 | + $request = CartUpdateRequest::ofIdAndVersion($cart->getId(), $cart->getVersion()) |
| 1444 | + ->addAction(CartChangeTaxCalculationModeAction::ofTaxCalculationMode(Cart::TAX_CALCULATION_MODE_UNIT_PRICE_LEVEL)) |
| 1445 | + ; |
| 1446 | + $response = $request->executeWithClient($this->getClient()); |
| 1447 | + $cart = $request->mapResponse($response); |
| 1448 | + |
| 1449 | + $this->deleteRequest->setVersion($cart->getVersion()); |
| 1450 | + |
| 1451 | + $this->assertSame(Cart::TAX_CALCULATION_MODE_UNIT_PRICE_LEVEL, $cart->getTaxCalculationMode()); |
| 1452 | + } |
| 1453 | + |
| 1454 | + public function testCreateWithTaxCalculationMode() |
| 1455 | + { |
| 1456 | + $draft = $this->getDraft(); |
| 1457 | + $draft->setTaxCalculationMode(Cart::TAX_CALCULATION_MODE_UNIT_PRICE_LEVEL); |
| 1458 | + $cart = $this->createCart($draft); |
| 1459 | + |
| 1460 | + $this->assertSame(Cart::TAX_CALCULATION_MODE_UNIT_PRICE_LEVEL, $cart->getTaxCalculationMode()); |
| 1461 | + } |
| 1462 | + |
| 1463 | + |
1435 | 1464 | public function testAutomaticDelete() |
1436 | 1465 | { |
1437 | 1466 | $draft = $this->getDraft(); |
|
0 commit comments