Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use C4::Context; |
19 |
use C4::Context; |
20 |
use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip ); |
20 |
use C4::Circulation qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfersFromTo TransferSlip ); |
21 |
use C4::Biblio qw( AddBiblio ); |
21 |
use C4::Biblio qw( AddBiblio ); |
22 |
use C4::Items qw( ModItemTransfer ); |
22 |
use C4::Items qw( ModItemTransfer ); |
23 |
use Koha::Database; |
23 |
use Koha::Database; |
Lines 27-44
use Koha::Item::Transfers;
Link Here
|
27 |
|
27 |
|
28 |
use t::lib::TestBuilder; |
28 |
use t::lib::TestBuilder; |
29 |
|
29 |
|
30 |
use Test::More tests => 22; |
30 |
use Test::More tests => 19; |
31 |
use Test::Deep; |
31 |
use Test::Deep; |
32 |
|
32 |
|
33 |
BEGIN { |
33 |
BEGIN { |
34 |
use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfers GetTransfersFromTo TransferSlip )); |
34 |
use_ok('C4::Circulation', qw( CreateBranchTransferLimit DeleteBranchTransferLimits GetTransfersFromTo TransferSlip )); |
35 |
} |
35 |
} |
36 |
can_ok( |
36 |
can_ok( |
37 |
'C4::Circulation', |
37 |
'C4::Circulation', |
38 |
qw( |
38 |
qw( |
39 |
CreateBranchTransferLimit |
39 |
CreateBranchTransferLimit |
40 |
DeleteBranchTransferLimits |
40 |
DeleteBranchTransferLimits |
41 |
GetTransfers |
|
|
42 |
GetTransfersFromTo |
41 |
GetTransfersFromTo |
43 |
) |
42 |
) |
44 |
); |
43 |
); |
Lines 168-187
is(CreateBranchTransferLimit(undef,$branchcode_2),undef,
Link Here
|
168 |
#branch_transfer_limits.toBranch and branch_transfer_limits.fromBranch aren't foreign keys |
167 |
#branch_transfer_limits.toBranch and branch_transfer_limits.fromBranch aren't foreign keys |
169 |
#is(CreateBranchTransferLimit(-1,-1,'CODE'),0,"With wrong CreateBranchTransferLimit returns 0 - No transfertlimit added"); |
168 |
#is(CreateBranchTransferLimit(-1,-1,'CODE'),0,"With wrong CreateBranchTransferLimit returns 0 - No transfertlimit added"); |
170 |
|
169 |
|
171 |
#Test GetTransfers |
|
|
172 |
my @transfers = GetTransfers($item_id1); |
173 |
cmp_deeply( |
174 |
\@transfers, |
175 |
[ re('^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$'), $branchcode_1, $branchcode_2, re('[0-9]*'), re('^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$'), 'Manual' ], |
176 |
"Transfers of the item1" |
177 |
); #NOTE: Only the first transfer is returned |
178 |
@transfers = GetTransfers; |
179 |
is_deeply( \@transfers, [], |
180 |
"GetTransfers without params returns an empty array" ); |
181 |
@transfers = GetTransfers(-1); |
182 |
is_deeply( \@transfers, [], |
183 |
"GetTransfers with a wrong item id returns an empty array" ); |
184 |
|
185 |
#Test GetTransfersFromTo |
170 |
#Test GetTransfersFromTo |
186 |
my @transferfrom1to2 = GetTransfersFromTo( $branchcode_1, |
171 |
my @transferfrom1to2 = GetTransfersFromTo( $branchcode_1, |
187 |
$branchcode_2 ); |
172 |
$branchcode_2 ); |
188 |
- |
|
|