Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 8; |
22 |
use Test::More tests => 9; |
23 |
|
23 |
|
24 |
use C4::Context; |
24 |
use C4::Context; |
25 |
use Koha::Database; |
25 |
use Koha::Database; |
Lines 27-32
use Koha::DateUtils;
Link Here
|
27 |
use Koha::Patron::Category; |
27 |
use Koha::Patron::Category; |
28 |
use Koha::Patron::Categories; |
28 |
use Koha::Patron::Categories; |
29 |
use t::lib::TestBuilder; |
29 |
use t::lib::TestBuilder; |
|
|
30 |
use t::lib::Mocks; |
30 |
|
31 |
|
31 |
my $schema = Koha::Database->new->schema; |
32 |
my $schema = Koha::Database->new->schema; |
32 |
$schema->storage->txn_begin; |
33 |
$schema->storage->txn_begin; |
Lines 83-88
subtest 'get_expiry_date' => sub {
Link Here
|
83 |
$category->delete; |
84 |
$category->delete; |
84 |
}; |
85 |
}; |
85 |
|
86 |
|
|
|
87 |
subtest 'BlockExpiredPatronOpacActions' => sub { |
88 |
plan tests => 2; |
89 |
t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 42); |
90 |
my $category = Koha::Patron::Category->new({ |
91 |
categorycode => 'ya_cat', |
92 |
category_type => 'A', |
93 |
description => 'yacatdesc', |
94 |
enrolmentperiod => undef, |
95 |
BlockExpiredPatronOpacActions => -1, |
96 |
})->store; |
97 |
is( $category->effective_BlockExpiredPatronOpacActions, 42 ); |
98 |
$category->BlockExpiredPatronOpacActions(24)->store; |
99 |
is( $category->effective_BlockExpiredPatronOpacActions, 24 ); |
100 |
$category->delete; |
101 |
}; |
102 |
|
86 |
$retrieved_category_1->delete; |
103 |
$retrieved_category_1->delete; |
87 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' ); |
104 |
is( Koha::Patron::Categories->search->count, $nb_of_categories + 1, 'Delete should have deleted the patron category' ); |
88 |
|
105 |
|
89 |
- |
|
|