Lines 191-197
sub run_tests {
Link Here
|
191 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
191 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
192 |
} |
192 |
} |
193 |
|
193 |
|
194 |
|
|
|
195 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
194 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
196 |
"GetMarcPrice returns the correct value"); |
195 |
"GetMarcPrice returns the correct value"); |
197 |
my $newincbiblioitemnumber=$biblioitemnumber+1; |
196 |
my $newincbiblioitemnumber=$biblioitemnumber+1; |
Lines 207-212
sub run_tests {
Link Here
|
207 |
$biblioitemnumbertotest = $updatedrecord->field($biblioitem_tag)->subfield($biblioitem_subfield); |
206 |
$biblioitemnumbertotest = $updatedrecord->field($biblioitem_tag)->subfield($biblioitem_subfield); |
208 |
} |
207 |
} |
209 |
is ($newincbiblioitemnumber, $biblioitemnumbertotest); |
208 |
is ($newincbiblioitemnumber, $biblioitemnumbertotest); |
|
|
209 |
|
210 |
# test for GetMarcNotes |
211 |
my $a1= GetMarcNotes( $marc_record, $marcflavour ); |
212 |
my $field2 = MARC::Field->new( $marcflavour eq 'UNIMARC'? 300: 555, 0, '', a=> 'Some text', u=> 'http://url-1.com', u=> 'nohttp://something_else' ); |
213 |
$marc_record->append_fields( $field2 ); |
214 |
my $a2= GetMarcNotes( $marc_record, $marcflavour ); |
215 |
my $last= @$a2? $a2->[@$a2-1]->{marcnote}: ''; |
216 |
is( @$a2 == @$a1 + 1 && ( |
217 |
( $marcflavour eq 'UNIMARC' && $last eq $field2->as_string() ) || |
218 |
( $marcflavour ne 'UNIMARC' && $last =~ /\<a href=/ )), |
219 |
1, 'Test for GetMarcNotes' ); |
210 |
} |
220 |
} |
211 |
|
221 |
|
212 |
sub mock_marcfromkohafield { |
222 |
sub mock_marcfromkohafield { |
Lines 273-291
sub create_issn_field {
Link Here
|
273 |
} |
283 |
} |
274 |
|
284 |
|
275 |
subtest 'MARC21' => sub { |
285 |
subtest 'MARC21' => sub { |
276 |
plan tests => 28; |
286 |
plan tests => 29; |
277 |
run_tests('MARC21'); |
287 |
run_tests('MARC21'); |
278 |
$dbh->rollback; |
288 |
$dbh->rollback; |
279 |
}; |
289 |
}; |
280 |
|
290 |
|
281 |
subtest 'UNIMARC' => sub { |
291 |
subtest 'UNIMARC' => sub { |
282 |
plan tests => 28; |
292 |
plan tests => 29; |
283 |
run_tests('UNIMARC'); |
293 |
run_tests('UNIMARC'); |
284 |
$dbh->rollback; |
294 |
$dbh->rollback; |
285 |
}; |
295 |
}; |
286 |
|
296 |
|
287 |
subtest 'NORMARC' => sub { |
297 |
subtest 'NORMARC' => sub { |
288 |
plan tests => 28; |
298 |
plan tests => 29; |
289 |
run_tests('NORMARC'); |
299 |
run_tests('NORMARC'); |
290 |
$dbh->rollback; |
300 |
$dbh->rollback; |
291 |
}; |
301 |
}; |
292 |
- |
|
|