Bug 16671: [QA Follow-up] Add new itemtype and remove bailout
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 27 Jun 2016 07:24:14 +0000 (09:24 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 8 Jul 2016 12:47:14 +0000 (12:47 +0000)
No need to bail out, if we are using TestBuilder.
Somehow, this test passes with me if we add a new record, and if
we do not, it fails (using BK as the first itemtype with notforloan
is 0).

Looking further, we should imo remove the Koha::ItemTypes searches
here and not depend on existing data. Just add some item types.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/HoldsQueue.t

index 5b1f09e..5302b47 100755 (executable)
@@ -61,8 +61,7 @@ my $borrower_branchcode = $borrower->{branchcode};
 my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} );
 my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} );
 my $least_cost_branch_code = pop @other_branches;
-my $itemtype = Koha::ItemTypes->search({ notforloan => 0 })->next->itemtype;
-$itemtype or BAIL_OUT("No adequate itemtype");
+my $itemtype = $builder->build({ source => 'Itemtype', value => { notforloan => 0 } })->{itemtype};
 
 #Set up the stage
 # Sysprefs and cost matrix