Move Cart to Moose.

Remove the global AddressBook cache, replace it with a per-object cache.  Merge create into
new, but leave a create stub for legacy code.
This commit is contained in:
Colin Kuskie 2010-07-07 15:30:47 -07:00
parent 416f62f36a
commit a1f1bf450a
2 changed files with 204 additions and 139 deletions

View file

@ -33,7 +33,7 @@ my $i18n = WebGUI::International->new($session, "Shop");
#----------------------------------------------------------------------------
# Tests
plan tests => 30; # Increment this number for each test you create
plan tests => 29; # Increment this number for each test you create
#----------------------------------------------------------------------------
# put your tests here
@ -81,11 +81,7 @@ $item->update({shippingAddressId => "XXXX"});
is($item->get("shippingAddressId"), "XXXX", "Can set shippingAddressId in the cart item properties.");
$item->update({shippingAddressId => undef});
my $now = time();
$cart->update({creationDate => $now});
is($cart->get('creationDate'), $now, 'update: set creationDate');
like($cart->getId, qr/[A-Za-z0-9\_\-]{22}/, "Id looks like a guid.");
ok($session->id->valid($cart->getId), "Id looks like a guid.");
is(ref($cart->get), "HASH", "Cart properties are a hash reference.");
is($cart->get("sessionId"), $session->getId, "Can retrieve a value from the cart properties.");