Lines 1-13
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
use strict; |
3 |
use Modern::Perl; |
4 |
use warnings; |
|
|
5 |
|
4 |
|
6 |
use t::lib::Mocks; |
5 |
use t::lib::Mocks; |
7 |
use C4::Context; |
6 |
use C4::Context; |
8 |
use C4::Branch; |
7 |
use C4::Branch; |
9 |
|
8 |
|
10 |
use Test::More tests => 22; |
9 |
use Test::More tests => 23; |
11 |
use MARC::Record; |
10 |
use MARC::Record; |
12 |
use C4::Biblio; |
11 |
use C4::Biblio; |
13 |
use C4::Items; |
12 |
use C4::Items; |
Lines 215-220
ok(
Link Here
|
215 |
'... unless canreservefromotherbranches is ON (bug 2394)' |
214 |
'... unless canreservefromotherbranches is ON (bug 2394)' |
216 |
); |
215 |
); |
217 |
|
216 |
|
|
|
217 |
# Regression test for bug 11336 |
218 |
($bibnum, $title, $bibitemnum) = create_helper_biblio(); |
219 |
my ( $hold1, $hold2 ); |
220 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); |
221 |
AddReserve( |
222 |
$branch, |
223 |
$borrowernumbers[0], |
224 |
$bibnum, |
225 |
'a', |
226 |
'', |
227 |
1, |
228 |
); |
229 |
|
230 |
my $reserveid1 = C4::Reserves::GetReserveId( |
231 |
{ |
232 |
biblionumber => $bibnum, |
233 |
borrowernumber => $borrowernumbers[0] |
234 |
} |
235 |
); |
236 |
|
237 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); |
238 |
AddReserve( |
239 |
$branch, |
240 |
$borrowernumbers[1], |
241 |
$bibnum, |
242 |
'a', |
243 |
'', |
244 |
2, |
245 |
); |
246 |
my $reserveid2 = C4::Reserves::GetReserveId( |
247 |
{ |
248 |
biblionumber => $bibnum, |
249 |
borrowernumber => $borrowernumbers[1] |
250 |
} |
251 |
); |
252 |
|
253 |
CancelReserve({ reserve_id => $reserveid1 }); |
254 |
|
255 |
$reserve2 = GetReserve( $reserveid2 ); |
256 |
is( $reserve2->{priority}, 1, "After cancelreserve, the 2nd reserve become the first on the waiting list" ); |
257 |
|
258 |
|
259 |
|
218 |
# Helper method to set up a Biblio. |
260 |
# Helper method to set up a Biblio. |
219 |
sub create_helper_biblio { |
261 |
sub create_helper_biblio { |
220 |
my $bib = MARC::Record->new(); |
262 |
my $bib = MARC::Record->new(); |
221 |
- |
|
|