Branch Coverage

blib/lib/Interchange6/Cart.pm
Criterion Covered Total %
branch 71 72 100.0


line true false branch
288 2 17 unless defined $product
290 15 2 unless $product->$Interchange6::Cart::_isa($self->product_class)
297 11 4 if ($product->should_combine_by_sku)
303 4 5 if $_->sku eq $product->sku
305 2 9 if ($index >= 0)
320 13 2 unless ($update)
393 2 15 unless @_ and defined $_[0]
395 4 11 ref $_[0] eq '' ? :
397 6 9 if (defined $args{'index'}) { }
3 6 elsif (defined $args{'id'}) { }
5 1 elsif (defined $args{'sku'}) { }
398 3 3 unless $args{'index'} =~ /^\d+$/
404 5 3 if defined $_->id
406 1 2 if (@cart_products == 1) { }
1 1 elsif (@cart_products > 1) { }
408 1 1 if defined $_->id
421 2 3 if (@cart_products == 1) { }
2 1 elsif (@cart_products > 1) { }
439 0 6 unless defined $ret
468 1 3 unless ref $product_ref eq 'ARRAY'
525 14 10 if (ref $args[0] eq '') { }
9 1 elsif (ref $args[0] eq 'HASH') { }
532 1 13 unless defined $sku
536 1 12 if (@cart_products == 0) { }
11 1 elsif (@cart_products == 1) { }
559 5 4 if (defined $selectors{'index'}) { }
562 1 4 unless $selectors{'index'} =~ /^\d+$/
569 2 2 if (defined $selectors{'id'}) { }
1 1 elsif (defined $selectors{'sku'}) { }
573 2 4 if defined $_->id
585 1 2 if (@cart_products == 0) { }
1 1 elsif (@cart_products == 1) { }
603 1 15 unless $product
605 3 12 unless defined $qty and ref $qty eq ''
608 1 11 if ($qty == 0)
614 2 9 if $qty == $product->quantity