Lines 1082-1090
subtest 'reserves.item_level_hold' => sub {
Link Here
|
1082 |
|
1082 |
|
1083 |
}; |
1083 |
}; |
1084 |
|
1084 |
|
1085 |
subtest 'MoveReserve additional test' => sub { |
1085 |
subtest 'MoveReserve additional tests' => sub { |
1086 |
|
1086 |
|
1087 |
plan tests => 4; |
1087 |
plan tests => 8; |
1088 |
|
1088 |
|
1089 |
# Create the items and patrons we need |
1089 |
# Create the items and patrons we need |
1090 |
my $biblio = $builder->build_sample_biblio(); |
1090 |
my $biblio = $builder->build_sample_biblio(); |
Lines 1124-1129
subtest 'MoveReserve additional test' => sub {
Link Here
|
1124 |
is($patron_2->holds->count, 0, "The 2nd patrons no longer has a hold"); |
1124 |
is($patron_2->holds->count, 0, "The 2nd patrons no longer has a hold"); |
1125 |
is($patron_2->old_holds->next()->reserve_id, $reserve_2, "The 2nd patrons hold was filled and moved to old holds"); |
1125 |
is($patron_2->old_holds->next()->reserve_id, $reserve_2, "The 2nd patrons hold was filled and moved to old holds"); |
1126 |
|
1126 |
|
|
|
1127 |
# Confirm that if a patron has a hold on an item that violates hold policies the hold is still filled when issuing the item |
1128 |
Koha::CirculationRules->set_rule( |
1129 |
{ |
1130 |
branchcode => undef, |
1131 |
itemtype => $itype->itemtype, |
1132 |
rule_name => 'holdallowed', |
1133 |
rule_value => 'not_allowed' |
1134 |
} |
1135 |
); |
1136 |
MoveReserve( $item_1->itemnumber, $patron_1->borrowernumber ); |
1137 |
is( $patron_1->holds->count, 0, "The 1st patron no longer has a hold" ); |
1138 |
is( |
1139 |
$patron_1->old_holds->next()->reserve_id, $reserve_1, |
1140 |
"The 1st patrons hold was filled and moved to old holds even when item not holdable" |
1141 |
); |
1142 |
|
1143 |
# Confirm that if a patron has a hold on a title and is issued an item that violates hold policies the hold is still filled |
1144 |
my $reserve_3 = AddReserve( |
1145 |
{ |
1146 |
branchcode => $item_1->homebranch, |
1147 |
borrowernumber => $patron_1->borrowernumber, |
1148 |
biblionumber => $biblio->biblionumber, |
1149 |
priority => 1, |
1150 |
itemnumber => undef, |
1151 |
} |
1152 |
); |
1153 |
MoveReserve( $item_1->itemnumber, $patron_1->borrowernumber ); |
1154 |
is( $patron_1->holds->count, 0, "The 1st patron no longer has a hold" ); |
1155 |
is( |
1156 |
$patron_1->old_holds->next()->reserve_id, $reserve_1, |
1157 |
"The 1st patrons hold was filled and moved to old holds even when item not holdable" |
1158 |
); |
1159 |
|
1127 |
}; |
1160 |
}; |
1128 |
|
1161 |
|
1129 |
subtest 'RevertWaitingStatus' => sub { |
1162 |
subtest 'RevertWaitingStatus' => sub { |
1130 |
- |
|
|