Lines 3-9
Link Here
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
use C4::Context; |
4 |
use C4::Context; |
5 |
|
5 |
|
6 |
use Test::More tests => 47; |
6 |
use Test::More tests => 49; |
7 |
use Test::MockModule; |
7 |
use Test::MockModule; |
8 |
|
8 |
|
9 |
use_ok('C4::Acquisition'); |
9 |
use_ok('C4::Acquisition'); |
Lines 129-131
is(scalar(@$history), 1);
Link Here
|
129 |
@bound_params = @{ $history->[0]->{bound_params} }; |
129 |
@bound_params = @{ $history->[0]->{bound_params} }; |
130 |
is(scalar(@bound_params), 1); |
130 |
is(scalar(@bound_params), 1); |
131 |
is($bound_params[0], 42); |
131 |
is($bound_params[0], 42); |
132 |
- |
132 |
my $checkordersrs = [ |
|
|
133 |
[qw(COUNT)], |
134 |
[2] |
135 |
]; |
136 |
|
137 |
$dbh->{mock_add_resultset} = $checkordersrs; |
138 |
is(DelInvoice(42), undef, "Invoices with items don't get deleted"); |
139 |
|
140 |
$checkordersrs = [ |
141 |
[qw(COUNT)], |
142 |
[0] |
143 |
]; |
144 |
|
145 |
my $deleters = [ |
146 |
[qw(COUNT)], |
147 |
[1] |
148 |
]; |
149 |
|
150 |
$dbh->{mock_add_resultset} = $checkordersrs; |
151 |
$dbh->{mock_add_resultset} = $deleters; |
152 |
ok(DelInvoice(42), "Invoices with items do get deleted"); |