From 620a8fb82384ea44c4e2c2ed74b83f11e509420e 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 Signed-off-by: Kyle M Hall --- 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 8e79d199e9..8395f52bc2 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.39.5