|
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 Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use t::lib::Mocks; |
22 |
use t::lib::Mocks; |
| 23 |
|
23 |
|
|
Lines 88-90
subtest "Koha::Template::Plugin::Koha::ArePluginsEnabled tests" => sub {
Link Here
|
| 88 |
is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no"); |
88 |
is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no"); |
| 89 |
|
89 |
|
| 90 |
}; |
90 |
}; |
| 91 |
- |
91 |
|
|
|
92 |
subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub { |
| 93 |
|
| 94 |
plan tests => 8; |
| 95 |
|
| 96 |
my $plugin = Koha::Template::Plugin::Koha->new(); |
| 97 |
|
| 98 |
t::lib::Mocks::mock_preference('CSVDelimiter', ''); |
| 99 |
is($plugin->CSVDelimiter(), ',', "CSVDelimiter() returns comma when preference is empty string"); |
| 100 |
|
| 101 |
t::lib::Mocks::mock_preference('CSVDelimiter', undef); |
| 102 |
is($plugin->CSVDelimiter(), ',', "CSVDelimiter() returns comma when preference is undefined"); |
| 103 |
|
| 104 |
t::lib::Mocks::mock_preference('CSVDelimiter', ';'); |
| 105 |
is($plugin->CSVDelimiter(), ';', "CSVDelimiter() returns preference value when preference is not tabulation"); |
| 106 |
|
| 107 |
t::lib::Mocks::mock_preference('CSVDelimiter', 'tabulation'); |
| 108 |
is($plugin->CSVDelimiter(), "\t", "CSVDelimiter() returns \\t when preference is tabulation"); |
| 109 |
|
| 110 |
t::lib::Mocks::mock_preference('CSVDelimiter', '#'); |
| 111 |
is($plugin->CSVDelimiter(undef), '#', "CSVDelimiter(arg) returns preference value when arg is undefined"); |
| 112 |
is($plugin->CSVDelimiter(''), '#', "CSVDelimiter(arg) returns preference value when arg is empty string"); |
| 113 |
is($plugin->CSVDelimiter(','), ',', "CSVDelimiter(arg) returns arg value when arg is not tabulation"); |
| 114 |
is($plugin->CSVDelimiter('tabulation'), "\t", "CSVDelimiter(arg) returns \\t value when arg is tabulation"); |
| 115 |
}; |