Lines 199-205
sub run_tests {
Link Here
|
199 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
199 |
"(GetMarcISBN) Corretly retrieves ISBN #". ($i + 1)); |
200 |
} |
200 |
} |
201 |
|
201 |
|
202 |
|
|
|
203 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
202 |
is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, |
204 |
"GetMarcPrice returns the correct value"); |
203 |
"GetMarcPrice returns the correct value"); |
205 |
my $newincbiblioitemnumber=$biblioitemnumber+1; |
204 |
my $newincbiblioitemnumber=$biblioitemnumber+1; |
Lines 215-220
sub run_tests {
Link Here
|
215 |
$biblioitemnumbertotest = $updatedrecord->field($biblioitem_tag)->subfield($biblioitem_subfield); |
214 |
$biblioitemnumbertotest = $updatedrecord->field($biblioitem_tag)->subfield($biblioitem_subfield); |
216 |
} |
215 |
} |
217 |
is ($newincbiblioitemnumber, $biblioitemnumbertotest); |
216 |
is ($newincbiblioitemnumber, $biblioitemnumbertotest); |
|
|
217 |
|
218 |
# test for GetMarcNotes |
219 |
my $a1= GetMarcNotes( $marc_record, $marcflavour ); |
220 |
my $field2 = MARC::Field->new( $marcflavour eq 'UNIMARC'? 300: 555, 0, '', a=> 'Some text', u=> 'http://url-1.com', u=> 'nohttp://something_else' ); |
221 |
$marc_record->append_fields( $field2 ); |
222 |
my $a2= GetMarcNotes( $marc_record, $marcflavour ); |
223 |
my $last= @$a2? $a2->[@$a2-1]->{marcnote}: ''; |
224 |
is( @$a2 == @$a1 + 1 && ( |
225 |
( $marcflavour eq 'UNIMARC' && $last eq $field2->as_string() ) || |
226 |
( $marcflavour ne 'UNIMARC' && $last =~ /\<a href=/ )), |
227 |
1, 'Test for GetMarcNotes' ); |
218 |
} |
228 |
} |
219 |
|
229 |
|
220 |
sub mock_marcfromkohafield { |
230 |
sub mock_marcfromkohafield { |
Lines 281-299
sub create_issn_field {
Link Here
|
281 |
} |
291 |
} |
282 |
|
292 |
|
283 |
subtest 'MARC21' => sub { |
293 |
subtest 'MARC21' => sub { |
284 |
plan tests => 28; |
294 |
plan tests => 29; |
285 |
run_tests('MARC21'); |
295 |
run_tests('MARC21'); |
286 |
$dbh->rollback; |
296 |
$dbh->rollback; |
287 |
}; |
297 |
}; |
288 |
|
298 |
|
289 |
subtest 'UNIMARC' => sub { |
299 |
subtest 'UNIMARC' => sub { |
290 |
plan tests => 28; |
300 |
plan tests => 29; |
291 |
run_tests('UNIMARC'); |
301 |
run_tests('UNIMARC'); |
292 |
$dbh->rollback; |
302 |
$dbh->rollback; |
293 |
}; |
303 |
}; |
294 |
|
304 |
|
295 |
subtest 'NORMARC' => sub { |
305 |
subtest 'NORMARC' => sub { |
296 |
plan tests => 28; |
306 |
plan tests => 29; |
297 |
run_tests('NORMARC'); |
307 |
run_tests('NORMARC'); |
298 |
$dbh->rollback; |
308 |
$dbh->rollback; |
299 |
}; |
309 |
}; |
300 |
- |
|
|