|
Line 0
Link Here
|
| 0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
|
| 3 |
# Copyright 2013 Equinox Software, Inc. |
| 4 |
# |
| 5 |
# This file is part of Koha. |
| 6 |
# |
| 7 |
# Koha is free software; you can redistribute it and/or modify it under the |
| 8 |
# terms of the GNU General Public License as published by the Free Software |
| 9 |
# Foundation; either version 3 of the License, or (at your option) any later |
| 10 |
# version. |
| 11 |
# |
| 12 |
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
| 13 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 14 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License along |
| 17 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
| 18 |
|
| 19 |
use Modern::Perl; |
| 20 |
|
| 21 |
use Test::More tests => 5; |
| 22 |
|
| 23 |
BEGIN { |
| 24 |
use_ok('Koha::Template::Plugin::KohaBranchName'); |
| 25 |
} |
| 26 |
|
| 27 |
my $filter = Koha::Template::Plugin::KohaBranchName->new(); |
| 28 |
ok($filter, "initialized KohaBranchName plugin"); |
| 29 |
|
| 30 |
my $name = $filter->filter('CPL'); |
| 31 |
is($name, 'Centerville', 'retrieved expected name for CPL'); |
| 32 |
|
| 33 |
$name = $filter->filter('__ANY__'); |
| 34 |
is($name, '', 'received empty string as name of the "__ANY__" placeholder library code'); |
| 35 |
|
| 36 |
$name = $filter->filter(undef); |
| 37 |
is($name, '', 'received empty string as name of NULL/undefined library code'); |