3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use Test
::More tests
=> 3;
23 use t
::lib
::Mocks
qw( mock_preference );
29 my $dbh = C4
::Context
->dbh;
31 $dbh->{AutoCommit
} = 0;
32 $dbh->{RaiseError
} = 1;
34 my $template = '#200|<h2>Title : |{200a}{ by 200f}|</h2>';
35 my $opac_template = '#200|<h2>Title : |{200a}{ (200f)}|</h2>';
36 t
::lib
::Mocks
::mock_preference
('isbd', $template);
37 t
::lib
::Mocks
::mock_preference
('opacisbd', $opac_template);
39 my $record = MARC
::Record
->new();
40 $record->append_fields(
41 MARC
::Field
->new('200', '', '', 'a' => 'Mountains'),
42 MARC
::Field
->new('200', '', '', 'f' => 'Keith Lye'),
44 my ($bibnum, $title, $bibitemnum) = AddBiblio
($record, '');
46 my $isbd = GetISBDView
($bibnum);
47 is
($isbd, '<h2>Title : Mountains by Keith Lye</h2>', 'ISBD is correct');
49 my $opacisbd = GetISBDView
($bibnum, 'opac');
50 is
($opacisbd, '<h2>Title : Mountains (Keith Lye)</h2>', 'OPAC ISBD is correct');