Fix getCollateral, which used to return direct copies instead of safe copies, and
add a test for that. addToCart does not adjust inventory, that is handled by the cart. Invert the sense of quantity in onAdjustQuantity.
This commit is contained in:
parent
ad92f6b628
commit
227745d975
2 changed files with 19 additions and 8 deletions
|
|
@ -35,7 +35,7 @@ my $session = WebGUI::Test->session;
|
|||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 32; # Increment this number for each test you create
|
||||
plan tests => 33; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# put your tests here
|
||||
|
|
@ -279,6 +279,18 @@ ok($session->id->valid($newVid), '... and it is a valid GUID');
|
|||
|
||||
$product4->purge;
|
||||
|
||||
my $product5 = $root->addChild({
|
||||
className => "WebGUI::Asset::Sku::Product",
|
||||
title => "Working in the laundry",
|
||||
});
|
||||
|
||||
$newVid = $product5->setCollateral('variantsJSON', 'vid', 'new', { check => 'no leaks', vid => 'new' });
|
||||
my $leak = $product5->getCollateral('variantsJSON', 'vid', $newVid);
|
||||
$leak->{check} = 'leaky';
|
||||
is( $product5->getCollateral('variantsJSON', 'vid', $newVid)->{check}, 'no leaks', 'getCollateral returns a safe copy');
|
||||
|
||||
$product5->purge;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Cleanup
|
||||
END {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue