Lines 15-26
use Data::Dumper;
Link Here
|
15 |
use Test::More tests => 23; |
15 |
use Test::More tests => 23; |
16 |
|
16 |
|
17 |
use C4::Branch; |
17 |
use C4::Branch; |
18 |
use C4::ItemType; |
|
|
19 |
use C4::Members; |
18 |
use C4::Members; |
20 |
use Koha::Database; |
19 |
use Koha::Database; |
21 |
|
20 |
|
22 |
use t::lib::TestBuilder; |
21 |
use t::lib::TestBuilder; |
23 |
|
22 |
|
|
|
23 |
use Koha::ItemTypes; |
24 |
|
24 |
BEGIN { |
25 |
BEGIN { |
25 |
use FindBin; |
26 |
use FindBin; |
26 |
use lib $FindBin::Bin; |
27 |
use lib $FindBin::Bin; |
Lines 60-68
my $borrower_branchcode = $borrower->{branchcode};
Link Here
|
60 |
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} ); |
61 |
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} ); |
61 |
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} ); |
62 |
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} ); |
62 |
my $least_cost_branch_code = pop @other_branches; |
63 |
my $least_cost_branch_code = pop @other_branches; |
63 |
my @item_types = C4::ItemType->all; |
64 |
my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next; |
64 |
my $itemtype = grep { $_->{notforloan} == 1 } @item_types |
65 |
$itemtype or BAIL_OUT("No adequate itemtype"); |
65 |
or BAIL_OUT("No adequate itemtype"); |
66 |
|
|
|
67 |
# FIXME Should be $itemtype = $itemtype->itemtype |
66 |
|
68 |
|
67 |
#Set up the stage |
69 |
#Set up the stage |
68 |
# Sysprefs and cost matrix |
70 |
# Sysprefs and cost matrix |
Lines 178-184
$dbh->do("DELETE FROM default_circ_rules");
Link Here
|
178 |
|
180 |
|
179 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
181 |
C4::Context->set_preference('UseTransportCostMatrix', 0); |
180 |
|
182 |
|
181 |
( $itemtype ) = @{ $dbh->selectrow_arrayref("SELECT itemtype FROM itemtypes LIMIT 1") }; |
183 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
182 |
|
184 |
|
183 |
$library1 = $builder->build({ |
185 |
$library1 = $builder->build({ |
184 |
source => 'Branch', |
186 |
source => 'Branch', |
Lines 308-314
is( @$holds_queue, 3, "Holds queue filling correct number for holds for default
Link Here
|
308 |
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); |
310 |
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue ); |
309 |
|
311 |
|
310 |
# Bug 14297 |
312 |
# Bug 14297 |
311 |
$itemtype = $item_types[0]->{itemtype}; |
313 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
312 |
$borrowernumber = $borrower3->{borrowernumber}; |
314 |
$borrowernumber = $borrower3->{borrowernumber}; |
313 |
my $library_A = $library1->{branchcode}; |
315 |
my $library_A = $library1->{branchcode}; |
314 |
my $library_B = $library2->{branchcode}; |
316 |
my $library_B = $library2->{branchcode}; |
Lines 365-371
is( @$holds_queue, 1, "Bug 14297 - Holds Queue building ignoring holds where pic
Link Here
|
365 |
# End Bug 14297 |
367 |
# End Bug 14297 |
366 |
|
368 |
|
367 |
# Bug 15062 |
369 |
# Bug 15062 |
368 |
$itemtype = $item_types[0]->{itemtype}; |
370 |
$itemtype = Koha::ItemTypes->search->next->itemtype; |
369 |
$borrowernumber = $borrower2->{borrowernumber}; |
371 |
$borrowernumber = $borrower2->{borrowernumber}; |
370 |
$library_A = $library1->{branchcode}; |
372 |
$library_A = $library1->{branchcode}; |
371 |
$library_B = $library2->{branchcode}; |
373 |
$library_B = $library2->{branchcode}; |
372 |
- |
|
|