|
Lines 272-277
sub run_tests {
Link Here
|
| 272 |
is( ( $marcflavour eq 'UNIMARC' && @$a2 == @$a1 + 1 ) || |
272 |
is( ( $marcflavour eq 'UNIMARC' && @$a2 == @$a1 + 1 ) || |
| 273 |
( $marcflavour ne 'UNIMARC' && @$a2 == @$a1 + 3 ), 1, |
273 |
( $marcflavour ne 'UNIMARC' && @$a2 == @$a1 + 3 ), 1, |
| 274 |
'Check the number of returned notes of GetMarcNotes' ); |
274 |
'Check the number of returned notes of GetMarcNotes' ); |
|
|
275 |
|
| 276 |
# test for GetMarcUrls |
| 277 |
$marc_record->append_fields( |
| 278 |
MARC::Field->new( '856', '', '', u => ' https://koha-community.org ' ), |
| 279 |
MARC::Field->new( '856', '', '', u => 'koha-community.org' ), |
| 280 |
); |
| 281 |
my $marcurl = GetMarcUrls( $marc_record, $marcflavour ); |
| 282 |
is( @$marcurl, 2, 'GetMarcUrls returns two URLs' ); |
| 283 |
like( $marcurl->[0]->{MARCURL}, qr/^https/, 'GetMarcUrls did not stumble over a preceding space' ); |
| 284 |
ok( $marcflavour ne 'MARC21' || $marcurl->[1]->{MARCURL} =~ /^http:\/\//, |
| 285 |
'GetMarcUrls prefixed a MARC21 URL with http://' ); |
| 275 |
} |
286 |
} |
| 276 |
|
287 |
|
| 277 |
sub get_title_field { |
288 |
sub get_title_field { |
|
Lines 326-344
sub create_issn_field {
Link Here
|
| 326 |
} |
337 |
} |
| 327 |
|
338 |
|
| 328 |
subtest 'MARC21' => sub { |
339 |
subtest 'MARC21' => sub { |
| 329 |
plan tests => 31; |
340 |
plan tests => 34; |
| 330 |
run_tests('MARC21'); |
341 |
run_tests('MARC21'); |
| 331 |
$dbh->rollback; |
342 |
$dbh->rollback; |
| 332 |
}; |
343 |
}; |
| 333 |
|
344 |
|
| 334 |
subtest 'UNIMARC' => sub { |
345 |
subtest 'UNIMARC' => sub { |
| 335 |
plan tests => 31; |
346 |
plan tests => 34; |
| 336 |
run_tests('UNIMARC'); |
347 |
run_tests('UNIMARC'); |
| 337 |
$dbh->rollback; |
348 |
$dbh->rollback; |
| 338 |
}; |
349 |
}; |
| 339 |
|
350 |
|
| 340 |
subtest 'NORMARC' => sub { |
351 |
subtest 'NORMARC' => sub { |
| 341 |
plan tests => 31; |
352 |
plan tests => 34; |
| 342 |
run_tests('NORMARC'); |
353 |
run_tests('NORMARC'); |
| 343 |
$dbh->rollback; |
354 |
$dbh->rollback; |
| 344 |
}; |
355 |
}; |
| 345 |
- |
|
|