fix a failing Shop::Ship test
This commit is contained in:
parent
8a04f5911f
commit
2fc985fe54
2 changed files with 4 additions and 4 deletions
|
|
@ -92,9 +92,9 @@ sub getDrivers {
|
||||||
Returns a list of options for the user to ship, along with the cost of using each one. It is a hash of hashrefs,
|
Returns a list of options for the user to ship, along with the cost of using each one. It is a hash of hashrefs,
|
||||||
with the key of the primary hash being the shipperId of the driver, and sub keys of label and price.
|
with the key of the primary hash being the shipperId of the driver, and sub keys of label and price.
|
||||||
|
|
||||||
=head3 $session
|
=head3 $cart
|
||||||
|
|
||||||
A WebGUI::Session object. A WebGUI::Error::InvalidParam exception will be thrown if it doesn't get one.
|
A WebGUI::Shop::Cart object. A WebGUI::Error::InvalidParam exception will be thrown if it doesn't get one.
|
||||||
|
|
||||||
=head3
|
=head3
|
||||||
|
|
||||||
|
|
@ -102,8 +102,8 @@ A WebGUI::Session object. A WebGUI::Error::InvalidParam exception will be throw
|
||||||
|
|
||||||
sub getOptions {
|
sub getOptions {
|
||||||
my ($class, $cart) = @_;
|
my ($class, $cart) = @_;
|
||||||
|
WebGUI::Error::InvalidParam->throw(error => q{Need a cart.}) unless defined $cart and $cart->isa("WebGUI::Shop::Cart");
|
||||||
my $session = $cart->session;
|
my $session = $cart->session;
|
||||||
WebGUI::Error::InvalidParam->throw(error => q{Need a cart.}) unless $cart->isa("WebGUI::Shop::Cart");
|
|
||||||
my %options = ();
|
my %options = ();
|
||||||
foreach my $shipper (@{$class->getShippers($session)}) {
|
foreach my $shipper (@{$class->getShippers($session)}) {
|
||||||
$options{$shipper->getId} = {
|
$options{$shipper->getId} = {
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ isa_ok($e, 'WebGUI::Error::InvalidParam', 'getOptions takes exception to not giv
|
||||||
cmp_deeply(
|
cmp_deeply(
|
||||||
$e,
|
$e,
|
||||||
methods(
|
methods(
|
||||||
error => 'Must provide a session variable',
|
error => 'Need a cart.',
|
||||||
),
|
),
|
||||||
'getOptions takes exception to not giving it a session object',
|
'getOptions takes exception to not giving it a session object',
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue