From 4e1d96e2a03b04d4ed513612162ec11ea5fa2341 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 19 Oct 2016 14:14:41 +0100 Subject: [PATCH] Bug 17431: Create the object we need instead of assuming something exists Signed-off-by: Jonathan Druart Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/api/v1/holds.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index 8e79d19..8395f52 100644 --- a/t/db_dependent/api/v1/holds.t +++ b/t/db_dependent/api/v1/holds.t @@ -41,8 +41,8 @@ $ENV{REMOTE_ADDR} = '127.0.0.1'; my $t = Test::Mojo->new('Koha::REST::V1'); my $tx; -my $categorycode = Koha::Database->new()->schema()->resultset('Category')->first()->categorycode(); -my $branchcode = Koha::Database->new()->schema()->resultset('Branch')->first()->branchcode(); +my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; +my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; # User without any permissions my $nopermission = $builder->build({ -- 2.7.4