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 <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 853d355576)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Jonathan Druart 2016-12-28 09:57:14 +01:00 committed by Katrin Fischer
parent ff6a1f666f
commit ec1773b112
1 changed files with 5 additions and 5 deletions

View File

@ -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(
{