Lines 16-22
Link Here
|
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use Test::More tests => 4; |
19 |
use Test::More tests => 3; |
20 |
|
20 |
|
21 |
use t::lib::Mocks; |
21 |
use t::lib::Mocks; |
22 |
use t::lib::TestBuilder; |
22 |
use t::lib::TestBuilder; |
Lines 43-67
is( $retrieved_pref->value, $new_pref->value, 'Find a pref by variable should re
Link Here
|
43 |
$retrieved_pref->delete; |
43 |
$retrieved_pref->delete; |
44 |
is( Koha::Config::SysPrefs->search->count, $nb_of_prefs, 'Delete should have deleted the pref' ); |
44 |
is( Koha::Config::SysPrefs->search->count, $nb_of_prefs, 'Delete should have deleted the pref' ); |
45 |
|
45 |
|
46 |
subtest 'get_yaml_pref_hash' => sub { |
|
|
47 |
|
48 |
plan tests => 1; |
49 |
|
50 |
my $the_pref = Koha::Config::SysPrefs->find({variable=>'ItemsDeniedRenewal'}); |
51 |
t::lib::Mocks::mock_preference('ItemsDeniedRenewal', q{ |
52 |
nulled: [NULL,''] |
53 |
this: [just_that] |
54 |
multi_this: [that,another] |
55 |
}); |
56 |
|
57 |
my $expected_hash = { |
58 |
nulled => [undef,""], |
59 |
this => ['just_that'], |
60 |
multi_this => ['that','another'], |
61 |
}; |
62 |
my $got_hash = $the_pref->get_yaml_pref_hash(); |
63 |
is_deeply($got_hash,$expected_hash,"Pref fetched and converted correctly"); |
64 |
|
65 |
}; |
66 |
|
67 |
$schema->storage->txn_rollback; |
46 |
$schema->storage->txn_rollback; |
68 |
- |
|
|