From 7e22d0aaca027d63a6f466c3031787c8c3a4beef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Dec 2016 09:57:14 +0100 Subject: [PATCH] Bug 17742: Use TestBuilder to create the library and patron category Moreover we do not need to remove the existing issues and patrons Signed-off-by: Jonathan Druart --- t/db_dependent/Patrons.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t index b0b6b60..40f770d 100755 --- a/t/db_dependent/Patrons.t +++ b/t/db_dependent/Patrons.t @@ -24,6 +24,8 @@ use C4::Context; use Koha::Database; use Koha::DateUtils; +use t::lib::TestBuilder; + BEGIN { use_ok('Koha::Objects'); use_ok('Koha::Patrons'); @@ -33,12 +35,10 @@ BEGIN { my $database = Koha::Database->new(); my $schema = $database->schema(); $schema->storage->txn_begin(); +my $builder = t::lib::TestBuilder->new; -$schema->resultset('Issue')->delete_all(); -$schema->resultset('Borrower')->delete_all(); - -my $categorycode = $schema->resultset('Category')->first()->categorycode(); -my $branchcode = $schema->resultset('Branch')->first()->branchcode(); +my $categorycode = $builder->build({ source => 'Category' })->{categorycode}; +my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; my $b1 = Koha::Patron->new( { -- 2.9.3