[Koha-bugs] [Bug 15391] New: Some tests in HoldsQueue.t should not pass

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 17 11:16:00 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15391

            Bug ID: 15391
           Summary: Some tests in HoldsQueue.t should not pass
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: gmcharlt at gmail.com
          Reporter: jonathan.druart at bugs.koha-community.org
        QA Contact: testopia at bugs.koha-community.org

We are checking if we have at least 1 item type not for loan:
 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:

# Looks like you failed 8 tests of 17 run.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list