|
Lines 20-27
Link Here
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
use FindBin qw( $Bin ); |
21 |
use FindBin qw( $Bin ); |
| 22 |
|
22 |
|
| 23 |
use Test::More tests => 3; |
23 |
use Test::NoWarnings; |
| 24 |
use Test::Warn; |
24 |
use Test::More tests => 4; |
| 25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
| 26 |
|
26 |
|
| 27 |
use t::lib::Mocks; |
27 |
use t::lib::Mocks; |
|
Lines 817-823
subtest 'process_invoice' => sub {
Link Here
|
| 817 |
}; |
817 |
}; |
| 818 |
|
818 |
|
| 819 |
subtest 'process_invoice_without_tax_rate' => sub { |
819 |
subtest 'process_invoice_without_tax_rate' => sub { |
| 820 |
plan tests => 4; |
820 |
plan tests => 3; |
| 821 |
|
821 |
|
| 822 |
$schema->storage->txn_begin; |
822 |
$schema->storage->txn_begin; |
| 823 |
|
823 |
|
|
Lines 873-895
subtest 'process_invoice_without_tax_rate' => sub {
Link Here
|
| 873 |
|
873 |
|
| 874 |
# Process the invoice - this should not generate warnings about undefined tax rates |
874 |
# Process the invoice - this should not generate warnings about undefined tax rates |
| 875 |
my $error; |
875 |
my $error; |
| 876 |
my $warnings = []; |
876 |
eval { |
| 877 |
{ |
877 |
process_invoice($invoice_message); |
| 878 |
local $SIG{__WARN__} = sub { push @$warnings, $_[0] }; |
878 |
1; |
| 879 |
eval { |
879 |
} or do { |
| 880 |
process_invoice($invoice_message); |
880 |
$error = $@; |
| 881 |
1; |
881 |
}; |
| 882 |
} or do { |
|
|
| 883 |
$error = $@; |
| 884 |
}; |
| 885 |
} |
| 886 |
|
| 887 |
ok( !$error, 'process_invoice completed without dying when no tax rate present' ); |
882 |
ok( !$error, 'process_invoice completed without dying when no tax rate present' ); |
| 888 |
|
883 |
|
| 889 |
# Check that no warnings about uninitialized values in multiplication were generated |
|
|
| 890 |
my $tax_warnings = grep { /Use of uninitialized value.*multiplication/ } @$warnings; |
| 891 |
is( $tax_warnings, 0, 'No warnings about uninitialized values in multiplication' ); |
| 892 |
|
| 893 |
# Verify that orders with tax data exist (means processing completed) |
884 |
# Verify that orders with tax data exist (means processing completed) |
| 894 |
my $orders = $schema->resultset('Aqorder')->search( |
885 |
my $orders = $schema->resultset('Aqorder')->search( |
| 895 |
{ |
886 |
{ |
| 896 |
- |
|
|