Koha/t/db_dependent/Patron/Housebound.t
Alex Sassmannshausen 89db872b41 Bug 5670: [QA Followup] Correct housebound role search.
* Koha/Patrons.pm (search_housebound_choosers)
  (search_housebound_deliverers): Use new table.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 18:18:06 +00:00

39 lines
751 B
Perl
Executable file

#!/usr/bin/perl
use Modern::Perl;
use C4::Members;
use C4::Circulation;
use Koha::Database;
use Koha::Patrons;
use Test::More tests => 2;
use_ok('Koha::Patron');
use t::lib::TestBuilder;
use t::lib::Mocks;
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
my $builder = t::lib::TestBuilder->new;
my $patron = $builder->build({ source => 'Borrower' });
my $profile = $builder->build({
source => 'HouseboundProfile',
value => {
borrowernumber => $patron->{borrowernumber},
},
});
# Test housebound_profile
is(
Koha::Patrons->find($patron->{borrowernumber})
->housebound_profile->frequency,
$profile->{frequency},
"Fetch housebound_profile."
);
$schema->storage->txn_rollback;
1;