Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 4; |
20 |
use Test::More tests => 5; |
21 |
use t::lib::TestBuilder; |
21 |
use t::lib::TestBuilder; |
22 |
|
22 |
|
23 |
use Koha::Patron::Categories; |
23 |
use Koha::Patron::Categories; |
Lines 57-59
is( Koha::Template::Plugin::Categories->GetName(
Link Here
|
57 |
|
57 |
|
58 |
$schema->storage->txn_rollback; |
58 |
$schema->storage->txn_rollback; |
59 |
|
59 |
|
60 |
- |
60 |
subtest 'can_any_reset_password() tests' => sub { |
|
|
61 |
|
62 |
plan tests => 2; |
63 |
|
64 |
$schema->storage->txn_begin; |
65 |
|
66 |
# Make sure all existing categories have can_reset_password set to 0 |
67 |
Koha::Patron::Categories->update({ can_reset_password => 0 }); |
68 |
|
69 |
ok( !Koha::Template::Plugin::Categories->new->can_any_reset_password, 'No category is allowed to reset password' ); |
70 |
|
71 |
$builder->build_object({ class => 'Koha::Patron::Categories', value => { can_reset_password => 1 } }); |
72 |
|
73 |
ok( Koha::Template::Plugin::Categories->new->can_any_reset_password, 'There\'s at least a category that is allowed to reset password' ); |
74 |
|
75 |
$schema->storage->txn_rollback; |
76 |
}; |
77 |
|