From 8078f81d18967d33016e4fc478dbeafddf62ad9b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 24 Feb 2014 08:39:16 -0500 Subject: [PATCH] Bug 11629 [QA Followup] - Unit Tests --- t/db_dependent/Circulation_issue.t | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Circulation_issue.t b/t/db_dependent/Circulation_issue.t index 18ef405..12066a7 100644 --- a/t/db_dependent/Circulation_issue.t +++ b/t/db_dependent/Circulation_issue.t @@ -10,7 +10,7 @@ use C4::Circulation; use C4::Items; use C4::Context; -use Test::More tests => 25; +use Test::More tests => 28; BEGIN { use_ok('C4::Circulation'); @@ -332,5 +332,31 @@ is_deeply( ); +my ($biblionumber, $biblioitemnumber, $itemnumber) = C4::Items::AddItem( + { + barcode => 'barcode_3', + itemcallnumber => 'callnumber3', + homebranch => $samplebranch1->{branchcode}, + holdingbranch => $samplebranch1->{branchcode}, + notforloan => 1, + }, + $biblionumber +); + +C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', q{} ); +AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); +my $item = GetItem( $itemnumber ); +ok( $item->{notforloan} eq 1, 'UpdateNotForLoanStatusOnCheckin does not modify value when not enabled' ); + +C4::Context->set_preference( 'UpdateNotForLoanStatusOnCheckin', '1: 9' ); +AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); +$item = GetItem( $itemnumber ); +ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin updates notforloan value from 1 to 9 with setting "1: 9"} ); + +AddReturn( 'barcode_3', $samplebranch1->{branchcode} ); +$item = GetItem( $itemnumber ); +ok( $item->{notforloan} eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} ); + + #End transaction $dbh->rollback; -- 1.7.2.5