Lines 76-82
subtest 'Biblio record' => sub {
Link Here
|
76 |
# A field (900) after 490 |
76 |
# A field (900) after 490 |
77 |
$input->param( -name => "tag_900_indicator1_1123", -value => "" ); |
77 |
$input->param( -name => "tag_900_indicator1_1123", -value => "" ); |
78 |
$input->param( -name => "tag_900_indicator2_1123", -value => "" ); |
78 |
$input->param( -name => "tag_900_indicator2_1123", -value => "" ); |
79 |
$input->param( -name => "tag_900_code_a_1123", -value => 'a' ); |
79 |
$input->param( -name => "tag_900_code_a_1123", -value => 'a' ); |
80 |
$input->param( -name => "tag_900_subfield_a_1123", -value => "This string has bad \x{1B}characters in it" ); |
80 |
$input->param( -name => "tag_900_subfield_a_1123", -value => "This string has bad \x{1B}characters in it" ); |
81 |
|
81 |
|
82 |
my $record = C4::Biblio::TransformHtmlToMarc($input, 1); |
82 |
my $record = C4::Biblio::TransformHtmlToMarc($input, 1); |
Lines 100-106
subtest 'Biblio record' => sub {
Link Here
|
100 |
|
100 |
|
101 |
my @fields_900 = $record->field('900'); |
101 |
my @fields_900 = $record->field('900'); |
102 |
is( @fields_900, 1, 'The record should have been created with 1 900' ); |
102 |
is( @fields_900, 1, 'The record should have been created with 1 900' ); |
103 |
is_deeply( $fields_900[0]->subfields(), [ 'a', 'This string has bad characters in it' ], 'Field 900 had its non-XML characters stripped'); |
103 |
is_deeply( |
|
|
104 |
$fields_900[0]->subfields(), [ 'a', 'This string has bad characters in it' ], |
105 |
'Field 900 had its non-XML characters stripped' |
106 |
); |
104 |
|
107 |
|
105 |
my @subfields_biblionumber = $record->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); |
108 |
my @subfields_biblionumber = $record->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); |
106 |
is( @subfields_biblionumber, 1, 'The record should contain only one biblionumber field' ); |
109 |
is( @subfields_biblionumber, 1, 'The record should contain only one biblionumber field' ); |
Lines 116-124
subtest 'Biblio record' => sub {
Link Here
|
116 |
is( $all_fields[5]->subfield('a'), 42, 'Sixth field contains bibnumber' ); |
119 |
is( $all_fields[5]->subfield('a'), 42, 'Sixth field contains bibnumber' ); |
117 |
is( $all_fields[6]->tag, '490', 'Last field is 490' ); |
120 |
is( $all_fields[6]->tag, '490', 'Last field is 490' ); |
118 |
|
121 |
|
119 |
my $new_record = eval { MARC::Record::new_from_xml( $record->as_xml(), 'UTF-8' ); }; |
122 |
my $new_record = eval { MARC::Record::new_from_xml( $record->as_xml(), 'UTF-8' ); }; |
120 |
my $record_error = $@; |
123 |
my $record_error = $@; |
121 |
ok( ! $record_error,'No errors parsing MARCXML generated by TransformHtmlToMarc'); |
124 |
ok( !$record_error, 'No errors parsing MARCXML generated by TransformHtmlToMarc' ); |
122 |
|
125 |
|
123 |
}; |
126 |
}; |
124 |
|
127 |
|
125 |
- |
|
|