From ebaaf40e5fac16b388fffa0fe26849dc23f058b7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 7 Nov 2016 16:00:21 -0300 Subject: [PATCH] Bug 17575: Remove itemtype-related warnings from Circulation.t To test: - Run: $ prove t/db_dependent/Circulation.t => FAIL: Lots of warnings - Apply the patch - Run: $ prove t/db_dependent/Circulation.t => SUCCESS: All green and no itemtype warnings - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Mason James --- t/db_dependent/Circulation.t | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 912c94b2b3..053ca2ffaa 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -53,6 +53,11 @@ my $library = $builder->build({ my $library2 = $builder->build({ source => 'Branch', }); +my $itemtype = $builder->build( + { source => 'Itemtype', + value => { notforloan => undef, rentalcharge => 0 } + } +)->{itemtype}; my $CircControl = C4::Context->preference('CircControl'); my $HomeOrHoldingBranch = C4::Context->preference('HomeOrHoldingBranch'); @@ -218,7 +223,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode, - replacementprice => 12.00 + replacementprice => 12.00, + itype => $itemtype }, $biblionumber ); @@ -229,7 +235,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode2, - replacementprice => 23.00 + replacementprice => 23.00, + itype => $itemtype }, $biblionumber ); @@ -240,7 +247,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode3, - replacementprice => 23.00 + replacementprice => 23.00, + itype => $itemtype }, $biblionumber ); @@ -393,7 +401,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); ModItem({ notforloan => 1 }, $biblionumber, $itemnumber); ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber, 1); is( $renewokay, 1, 'Can renew, item is marked not for loan, hold does not block'); - ModItem({ notforloan => 0, itype => '' }, $biblionumber, $itemnumber,1); + ModItem({ notforloan => 0, itype => $itemtype }, $biblionumber, $itemnumber,1); # FIXME: Add more for itemtype not for loan etc. @@ -404,7 +412,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode5, - replacementprice => 23.00 + replacementprice => 23.00, + itype => $itemtype }, $biblionumber ); @@ -424,7 +433,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode6, - replacementprice => 23.00 + replacementprice => 23.00, + itype => $itemtype }, $biblionumber ); @@ -435,7 +445,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode7, - replacementprice => 23.00 + replacementprice => 23.00, + itype => $itemtype }, $biblionumber ); @@ -484,7 +495,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode4, - replacementprice => 16.00 + replacementprice => 16.00, + itype => $itemtype }, $biblionumber ); @@ -650,7 +662,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); { homebranch => $branch, holdingbranch => $branch, - barcode => $barcode3 + barcode => $barcode3, + itype => $itemtype }, $biblionumber2 ); @@ -729,7 +742,8 @@ C4::Context->dbh->do("DELETE FROM accountlines"); { homebranch => $branch, holdingbranch => $branch, - barcode => $barcode + barcode => $barcode, + itype => $itemtype }, $biblionumber ); @@ -785,6 +799,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $library2->{branchcode}, holdingbranch => $library2->{branchcode}, barcode => $barcode1, + itype => $itemtype }, $biblionumber ); @@ -794,6 +809,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $library2->{branchcode}, holdingbranch => $library2->{branchcode}, barcode => $barcode2, + itype => $itemtype }, $biblionumber ); @@ -870,6 +886,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $branch, holdingbranch => $branch, barcode => $barcode, + itype => $itemtype }, $biblionumber ); @@ -900,6 +917,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, barcode => $barcode, + itype => $itemtype }, $biblionumber, ); -- 2.11.4.GIT