[Koha-bugs] [Bug 15391] HoldsQueue.t does not handle for loan itemtypes correctly
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Jan 20 23:27:37 CET 2016
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391
Katrin Fischer <katrin.fischer at bsz-bw.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #46990|0 |1
is obsolete| |
--- Comment #9 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Created attachment 47061
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47061&action=edit
[PASSED QA] Bug 15391: Fix HoldsQueue.t tests
Prior to this patch, in HoldsQueue.t:
63 my @item_types = C4::ItemType->all;
64 my $itemtype = grep { $_->{notforloan} == 1 } @item_types
65 or BAIL_OUT("No adequate itemtype");
Then we use the $itemtype variable (which contains the number of item types not
for loan):
92 $dbh->do("INSERT INTO biblioitems (biblionumber, marcxml, itemtype)
93 VALUES ($biblionumber, '', '$itemtype')");
There is obviously something wrong here.
The code should be
64 my @not_for_loan = grep { $_->{notforloan} == 1 } @item_types
65 or BAIL_OUT("No adequate itemtype");
66 my $itemtype = $not_for_loan[0]->{itemtype};
But then some tests don't pass:
Actually the problem comes from:
commit bfbc646fdd9ca4b90a0bc2751d0faa95d9e93ba1
Bug 10336: HoldsQueue.t needs to create its own data
-my $itemtype = $dbh->selectrow_array("SELECT min(itemtype) FROM itemtypes
WHERE notforloan = 0")
+my @item_types = C4::ItemType->all;
+my $itemtype = grep { $_->{notforloan} == 1 } @item_types
The line should have been:
my $itemtype = grep { $_->{notforloan} == 0 } @item_types
Test plan:
Confirm that the tests still pass after this patch applied.
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
All tests pass pre and post patch
Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list