Bug 29744: (QA follow-up) Only consider PLACK_ENV for underscore
[koha.git] / t / db_dependent / Patron / Housebound.t
1 #!/usr/bin/perl
2 use Modern::Perl;
3
4 use C4::Members;
5 use C4::Circulation;
6 use Koha::Database;
7 use Koha::Patrons;
8
9 use Test::More tests => 2;
10
11 use_ok('Koha::Patron');
12
13 use t::lib::TestBuilder;
14 use t::lib::Mocks;
15
16 my $schema = Koha::Database->new->schema;
17 $schema->storage->txn_begin;
18
19 my $builder = t::lib::TestBuilder->new;
20
21 my $patron = $builder->build({ source => 'Borrower' });
22 my $profile = $builder->build({
23     source => 'HouseboundProfile',
24     value  => {
25         borrowernumber => $patron->{borrowernumber},
26     },
27 });
28
29 # Test housebound_profile
30 is(
31     Koha::Patrons->find($patron->{borrowernumber})
32           ->housebound_profile->frequency,
33     $profile->{frequency},
34     "Fetch housebound_profile."
35 );
36
37 $schema->storage->txn_rollback;
38