|
Lines 27-33
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 { |
|
Lines 38-44
can_ok(
Link Here
|
| 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 |
- |
|
|