Bug 14285: Bengali locale needs to be re-defined
[koha.git] / t / db_dependent / RecordProcessor_EmbedSeeFromHeadings.t
blob0c637716046f523458f79bfcdd49344edfd39871
1 #!/usr/bin/perl
3 # Copyright 2012 C & P Bibliography Services
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use strict;
21 use warnings;
22 use File::Spec;
23 use MARC::Record;
24 use Koha::Authority;
26 use Test::More;
27 use Test::MockModule;
29 BEGIN {
30 use_ok('Koha::RecordProcessor');
33 my $module = new Test::MockModule('MARC::Record');
34 $module->mock('new_from_xml', sub {
35 my $record = MARC::Record->new;
37 $record->add_fields(
38 [ '001', '1234' ],
39 [ '150', ' ', ' ', a => 'Cooking' ],
40 [ '450', ' ', ' ', a => 'Cookery' ],
43 return $record;
44 });
46 my $bib = MARC::Record->new;
47 $bib->add_fields(
48 [ '245', '0', '4', a => 'The Ifrane cookbook' ],
49 [ '650', ' ', ' ', a => 'Cooking', 9 => '1234' ]
52 my $resultbib = MARC::Record->new;
53 $resultbib->add_fields(
54 [ '245', '0', '4', a => 'The Ifrane cookbook' ],
55 [ '650', ' ', ' ', a => 'Cooking', 9 => '1234' ],
56 [ '650', 'z', ' ', a => 'Cookery' ]
59 my $processor = Koha::RecordProcessor->new( { filters => ( 'EmbedSeeFromHeadings' ) } );
60 is(ref($processor), 'Koha::RecordProcessor', 'Created record processor');
62 my $result = $processor->process($bib);
64 is_deeply($result, $resultbib, 'Inserted see-from heading to record');
66 done_testing();