Add a few more tests to hit coverage. Check for non-numeric package IDs.
This commit is contained in:
parent
bfc05ddc7a
commit
e647c013b9
2 changed files with 93 additions and 5 deletions
|
|
@ -192,7 +192,7 @@ sub _calculateFromXML {
|
|||
foreach my $package (@{ $xmlData->{IntlRateResponse}->{Package} }) {
|
||||
my $id = $package->{ID};
|
||||
##Error check for invalid index
|
||||
if ($id < 0 || $id > $#shippableUnits) {
|
||||
if ($id < 0 || $id > $#shippableUnits || $id !~ /^\d+$/) {
|
||||
WebGUI::Error::Shop::RemoteShippingRate->throw(error => "Illegal package index returned by USPS: $id");
|
||||
}
|
||||
if (exists $package->{Error}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue