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 <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Tomas Cohen Arazi 2016-11-07 16:00:21 -03:00 committed by Mason James
parent 0f19991ac1
commit ebaaf40e5f
1 changed files with 28 additions and 10 deletions

View File

@ -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,
);