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>
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