From c09a3c02234e9c9b1baaac675c4928efa8e9e570 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 19 Oct 2016 14:14:41 +0100 Subject: [PATCH] [SIGNED-OFF] Bug 17431: Create the object we need instead of assuming something exists Signed-off-by: Jonathan Druart Signed-off-by: Josef Moravec --- 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.1.4