4 use Test::More tests => 4;
7 use C4::Biblio qw/TransformHtmlToXml/;
9 my $tags= [ '001', '100', '245', '245' ];
10 my $subfields = [ '', 'a', 'a', 'c' ];
11 my $values = [ '12345', 'author', 'title', 'resp' ];
12 my $ind = [ ' ', '00', ' 9', ' ' ];
14 my $xml = TransformHtmlToXml( $tags, $subfields, $values, $ind, undef, 'MARC21' );
15 my $xmlh = XML::Simple->new->XMLin( $xml );
17 # check number of controlfields
18 is( ref $xmlh->{record}->{controlfield}, 'HASH', 'One controlfield' );
20 my $cnt = @{$xmlh->{record}->{datafield}};
21 is( $cnt, 2, 'Two datafields' );
23 is( $xmlh->{record}->{datafield}->[1]->{subfield}->[1]->{content}, 'resp', 'Check value' );
24 # check second indicator of 245
25 is( $xmlh->{record}->{datafield}->[1]->{ind2}, '9', 'Check indicator' );