Lines 71-79
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
Link Here
|
71 |
|
71 |
|
72 |
## Setup Test |
72 |
## Setup Test |
73 |
# Add branches |
73 |
# Add branches |
74 |
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; |
74 |
my $branch_1 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
75 |
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; |
75 |
my $branch_2 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
76 |
my $branch_3 = $builder->build({ source => 'Branch' })->{ branchcode }; |
76 |
my $branch_3 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
77 |
# Add categories |
77 |
# Add categories |
78 |
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode }; |
78 |
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode }; |
79 |
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode }; |
79 |
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode }; |
Lines 108-113
my $borrower = $patron->unblessed;
Link Here
|
108 |
my $biblionumber = $bibnum; |
108 |
my $biblionumber = $bibnum; |
109 |
my $barcode = $testbarcode; |
109 |
my $barcode = $testbarcode; |
110 |
|
110 |
|
|
|
111 |
# Set circulation rules |
112 |
Koha::CirculationRules->set_rules( |
113 |
{ |
114 |
categorycode => undef, |
115 |
branchcode => undef, |
116 |
itemtype => undef, |
117 |
rules => { |
118 |
reservesallowed => 25, |
119 |
holds_per_record => 99, |
120 |
} |
121 |
} |
122 |
); |
123 |
|
111 |
my $branchcode = Koha::Libraries->search->next->branchcode; |
124 |
my $branchcode = Koha::Libraries->search->next->branchcode; |
112 |
|
125 |
|
113 |
AddReserve( |
126 |
AddReserve( |
Lines 215-220
Koha::CirculationRules->set_rules(
Link Here
|
215 |
} |
228 |
} |
216 |
} |
229 |
} |
217 |
); |
230 |
); |
|
|
231 |
Koha::CirculationRules->set_rules( |
232 |
{ |
233 |
categorycode => undef, |
234 |
branchcode => undef, |
235 |
itemtype => undef, |
236 |
rules => { |
237 |
reservesallowed => 25, |
238 |
holds_per_record => 99, |
239 |
} |
240 |
} |
241 |
); |
218 |
|
242 |
|
219 |
my $bibnum2 = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber; |
243 |
my $bibnum2 = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber; |
220 |
|
244 |
|
Lines 999-1007
subtest 'MoveReserve additional test' => sub {
Link Here
|
999 |
|
1023 |
|
1000 |
# Create the items and patrons we need |
1024 |
# Create the items and patrons we need |
1001 |
my $biblio = $builder->build_sample_biblio(); |
1025 |
my $biblio = $builder->build_sample_biblio(); |
|
|
1026 |
my $branch = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
1002 |
my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } }); |
1027 |
my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } }); |
1003 |
my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber,notforloan => 0, itype => $itype->itemtype }); |
1028 |
my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber,notforloan => 0, itype => $itype->itemtype, library => $branch }); |
1004 |
my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, notforloan => 0, itype => $itype->itemtype }); |
1029 |
my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, notforloan => 0, itype => $itype->itemtype, library => $branch }); |
1005 |
my $patron_1 = $builder->build_object({ class => "Koha::Patrons" }); |
1030 |
my $patron_1 = $builder->build_object({ class => "Koha::Patrons" }); |
1006 |
my $patron_2 = $builder->build_object({ class => "Koha::Patrons" }); |
1031 |
my $patron_2 = $builder->build_object({ class => "Koha::Patrons" }); |
1007 |
|
1032 |
|
Lines 1083-1090
subtest 'RevertWaitingStatus' => sub {
Link Here
|
1083 |
subtest 'CheckReserves additional tests' => sub { |
1108 |
subtest 'CheckReserves additional tests' => sub { |
1084 |
|
1109 |
|
1085 |
plan tests => 8; |
1110 |
plan tests => 8; |
|
|
1111 |
my $branch_1 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
1112 |
my $branch_2 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode }; |
1086 |
|
1113 |
|
1087 |
my $item = $builder->build_sample_item; |
1114 |
my $item = $builder->build_sample_item({ library => $branch_1 }); |
1088 |
my $reserve1 = $builder->build_object( |
1115 |
my $reserve1 = $builder->build_object( |
1089 |
{ |
1116 |
{ |
1090 |
class => "Koha::Holds", |
1117 |
class => "Koha::Holds", |
Lines 1156-1162
subtest 'CheckReserves additional tests' => sub {
Link Here
|
1156 |
$reserve1->reserve_id, "We got the Transit reserve" ); |
1183 |
$reserve1->reserve_id, "We got the Transit reserve" ); |
1157 |
is( scalar @$possible_reserves, 2, 'We do get both reserves' ); |
1184 |
is( scalar @$possible_reserves, 2, 'We do get both reserves' ); |
1158 |
|
1185 |
|
1159 |
my $patron_B = $builder->build_object({ class => "Koha::Patrons" }); |
1186 |
my $patron_B = $builder->build_object({ class => "Koha::Patrons", value => { branchcode => $branch_2, } }); |
1160 |
my $item_A = $builder->build_sample_item; |
1187 |
my $item_A = $builder->build_sample_item; |
1161 |
my $item_B = $builder->build_sample_item({ |
1188 |
my $item_B = $builder->build_sample_item({ |
1162 |
homebranch => $patron_B->branchcode, |
1189 |
homebranch => $patron_B->branchcode, |
1163 |
- |
|
|