Problem/motivation

CartManager.php is not tested. Issues like #2708455: Cart totals are not updated on updating line items could be caught with tests of CartManager.

Proposed resolution

Create a Kernel test CartManagerTest.php in cart module similar to CartProviderTest.php and order.module's Kernel\Entity\OrderTest.php

Remaining tasks

  1. Add new test(s) for CartManager.php covering all methods.

Completed tasks

(none)

Comments

steveoliver created an issue. See original summary.

steveoliver’s picture

Status: Active » Needs review

https://github.com/drupalcommerce/commerce/pull/547 contains a test covering all CartManager methods. The first commit tests (all passing) that verify the basics of the methods--that order items are added, updated, and removed. The second commit shows a test (failing) that verifies the order total after updating the quantity of the first order item. The third commit shows the test (passing) that verified the order total after updating the quantity of the first order item -- but by manually saving the $cart inline in the test -- showing that the issue in #2708455: Cart totals are not updated on updating line items indeed exists and is currently "fixed" by saving the cart after updating item quantities.

bojanz’s picture

Status: Needs review » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.