Lines 10-16
use C4::Circulation;
Link Here
|
10 |
use C4::Items; |
10 |
use C4::Items; |
11 |
use C4::Context; |
11 |
use C4::Context; |
12 |
|
12 |
|
13 |
use Test::More tests => 25; |
13 |
use Test::More tests => 28; |
14 |
|
14 |
|
15 |
BEGIN { |
15 |
BEGIN { |
16 |
use_ok('C4::Circulation'); |
16 |
use_ok('C4::Circulation'); |
Lines 332-336
is_deeply(
Link Here
|
332 |
); |
332 |
); |
333 |
|
333 |
|
334 |
|
334 |
|
|
|
335 |
my ($biblionumber, $biblioitemnumber, $itemnumber) = C4::Items::AddItem( |
336 |
{ |
337 |
barcode => 'barcode_3', |
338 |
itemcallnumber => 'callnumber3', |
339 |
homebranch => $samplebranch1->{branchcode}, |
340 |
holdingbranch => $samplebranch1->{branchcode}, |
341 |
notforloan => 1, |
342 |
}, |
343 |
$biblionumber |
344 |
); |
345 |
|
346 |
C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', q{} ); |
347 |
AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); |
348 |
my $item = GetItem( $itemnumber ); |
349 |
ok( $item->{notforloan} eq 1, 'UpdateNotForLoanStatusOnCheckin does not modify value when not enabled' ); |
350 |
|
351 |
C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', '1: 9' ); |
352 |
AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); |
353 |
$item = GetItem( $itemnumber ); |
354 |
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin updates notforloan value from 1 to 9 with setting "1: 9"} ); |
355 |
|
356 |
AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); |
357 |
$item = GetItem( $itemnumber ); |
358 |
ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} ); |
359 |
|
360 |
|
335 |
#End transaction |
361 |
#End transaction |
336 |
$dbh->rollback; |
362 |
$dbh->rollback; |
337 |
- |
|
|