|
Lines 6-12
use t::lib::Mocks;
Link Here
|
| 6 |
use C4::Context; |
6 |
use C4::Context; |
| 7 |
use C4::Branch; |
7 |
use C4::Branch; |
| 8 |
|
8 |
|
| 9 |
use Test::More tests => 38; |
9 |
use Test::More tests => 41; |
| 10 |
use MARC::Record; |
10 |
use MARC::Record; |
| 11 |
use C4::Biblio; |
11 |
use C4::Biblio; |
| 12 |
use C4::Items; |
12 |
use C4::Items; |
|
Lines 329-334
ok(
Link Here
|
| 329 |
"cannot request item if policy that matches on bib-level item type forbids it (bug 9532)" |
329 |
"cannot request item if policy that matches on bib-level item type forbids it (bug 9532)" |
| 330 |
); |
330 |
); |
| 331 |
|
331 |
|
|
|
332 |
|
| 333 |
# Test branch item rules |
| 334 |
|
| 335 |
$dbh->do('DELETE FROM issuingrules'); |
| 336 |
$dbh->do( |
| 337 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
| 338 |
VALUES (?, ?, ?, ?)}, |
| 339 |
{}, |
| 340 |
'*', '*', '*', 25 |
| 341 |
); |
| 342 |
$dbh->do('DELETE FROM branch_item_rules'); |
| 343 |
$dbh->do('DELETE FROM default_branch_circ_rules'); |
| 344 |
$dbh->do('DELETE FROM default_branch_item_rules'); |
| 345 |
$dbh->do('DELETE FROM default_circ_rules'); |
| 346 |
$dbh->do(q{ |
| 347 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
| 348 |
VALUES (?, ?, ?, ?) |
| 349 |
}, {}, 'CPL', 'CANNOT', 0, 'homebranch'); |
| 350 |
$dbh->do(q{ |
| 351 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
| 352 |
VALUES (?, ?, ?, ?) |
| 353 |
}, {}, 'CPL', 'CAN', 1, 'homebranch'); |
| 354 |
($bibnum, $title, $bibitemnum) = create_helper_biblio('CANNOT'); |
| 355 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
| 356 |
{ homebranch => 'CPL', holdingbranch => 'CPL', itype => 'CANNOT' } , $bibnum); |
| 357 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber), 'notReservable', |
| 358 |
"CanItemBeReserved should returns 'notReservable'"); |
| 359 |
|
| 360 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
| 361 |
{ homebranch => 'MPL', holdingbranch => 'CPL', itype => 'CAN' } , $bibnum); |
| 362 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber), |
| 363 |
'cannotReserveFromOtherBranches', |
| 364 |
"CanItemBeReserved should returns 'cannotReserveFromOtherBranches'"); |
| 365 |
|
| 366 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
| 367 |
{ homebranch => 'CPL', holdingbranch => 'CPL', itype => 'CAN' } , $bibnum); |
| 368 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber), 'OK', |
| 369 |
"CanItemBeReserved should returns 'OK'"); |
| 370 |
|
| 371 |
|
| 332 |
# Test CancelExpiredReserves |
372 |
# Test CancelExpiredReserves |
| 333 |
C4::Context->set_preference('ExpireReservesMaxPickUpDelay', 1); |
373 |
C4::Context->set_preference('ExpireReservesMaxPickUpDelay', 1); |
| 334 |
C4::Context->set_preference('ReservesMaxPickUpDelay', 1); |
374 |
C4::Context->set_preference('ReservesMaxPickUpDelay', 1); |
| 335 |
- |
|
|