While looking at the patch provided in #1492626: "Cart Items" triggers dont work I realised we need more cart tests to prove changes there will not break anything.

The attached patch extends tests for the cart API and also suggests two improvements:
- uc_cart_remove_item() should clear the cart cache
- uc_cart_empty() should default to the current cart

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Status: Needs review » Active

Committed the patch, back to active to improve the API as noted.

TR’s picture

I backported and committed above patch to D6, http://drupalcode.org/project/ubercart.git/commitdiff/390b81886c

longwave’s picture

Status: Active » Needs review
FileSize
997 bytes

uc_cart_remove_item() improvement

longwave’s picture

uc_cart_empty() improvement

TR’s picture

TR’s picture

#4: 1576894-uc_cart_empty-default.patch queued for re-testing.

longwave’s picture

Committed #4.

I am not sure whether #3 is actually justified; we provide the 'rebuild' parameter for a reason, this will reduce performance when emptying large carts, and this only fixes a test.

longwave’s picture

Status: Needs review » Fixed

Marking fixed based on #7, reviewing this again I don't see the point in changing uc_cart_remove_item().

Status: Fixed » Closed (fixed)

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