|
Lines 34-40
use Koha::MarcSubfieldStructures;
Link Here
|
| 34 |
use C4::Linker::Default qw( get_link ); |
34 |
use C4::Linker::Default qw( get_link ); |
| 35 |
|
35 |
|
| 36 |
BEGIN { |
36 |
BEGIN { |
| 37 |
use_ok('C4::Biblio', qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData ModBiblio GetMarcISSN GetMarcControlnumber GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio )); |
37 |
use_ok('C4::Biblio', qw( AddBiblio GetMarcFromKohaField BiblioAutoLink GetMarcSubfieldStructure GetMarcSubfieldStructureFromKohaField LinkBibHeadingsToAuthorities GetBiblioData ModBiblio GetMarcISSN GetMarcISBN GetMarcPrice GetFrameworkCode GetMarcUrls IsMarcStructureInternal GetMarcStructure GetXmlBiblio DelBiblio )); |
| 38 |
} |
38 |
} |
| 39 |
|
39 |
|
| 40 |
my $schema = Koha::Database->new->schema; |
40 |
my $schema = Koha::Database->new->schema; |
|
Lines 417-437
sub run_tests {
Link Here
|
| 417 |
is( scalar @$issns, 4, |
417 |
is( scalar @$issns, 4, |
| 418 |
'GetMARCISSN skips empty ISSN fields (Bug 12674)'); |
418 |
'GetMARCISSN skips empty ISSN fields (Bug 12674)'); |
| 419 |
|
419 |
|
| 420 |
## Testing GetMarcControlnumber |
|
|
| 421 |
my $controlnumber; |
| 422 |
$controlnumber = GetMarcControlnumber( $marc_record, $marcflavour ); |
| 423 |
is( $controlnumber, '', 'GetMarcControlnumber handles records without 001' ); |
| 424 |
|
| 425 |
$field = MARC::Field->new( '001', '' ); |
| 426 |
$marc_record->append_fields($field); |
| 427 |
$controlnumber = GetMarcControlnumber( $marc_record, $marcflavour ); |
| 428 |
is( $controlnumber, '', 'GetMarcControlnumber handles records with empty 001' ); |
| 429 |
|
| 430 |
$field = $marc_record->field('001'); |
| 431 |
$field->update('123456789X'); |
| 432 |
$controlnumber = GetMarcControlnumber( $marc_record, $marcflavour ); |
| 433 |
is( $controlnumber, '123456789X', 'GetMarcControlnumber handles records with 001' ); |
| 434 |
|
| 435 |
## Testing GetMarcISBN |
420 |
## Testing GetMarcISBN |
| 436 |
my $record_for_isbn = MARC::Record->new(); |
421 |
my $record_for_isbn = MARC::Record->new(); |
| 437 |
my $isbns = GetMarcISBN( $record_for_isbn, $marcflavour ); |
422 |
my $isbns = GetMarcISBN( $record_for_isbn, $marcflavour ); |
|
Lines 632-645
sub create_author_field {
Link Here
|
| 632 |
} |
617 |
} |
| 633 |
|
618 |
|
| 634 |
subtest 'MARC21' => sub { |
619 |
subtest 'MARC21' => sub { |
| 635 |
plan tests => 46; |
620 |
plan tests => 43; |
| 636 |
run_tests('MARC21'); |
621 |
run_tests('MARC21'); |
| 637 |
$schema->storage->txn_rollback; |
622 |
$schema->storage->txn_rollback; |
| 638 |
$schema->storage->txn_begin; |
623 |
$schema->storage->txn_begin; |
| 639 |
}; |
624 |
}; |
| 640 |
|
625 |
|
| 641 |
subtest 'UNIMARC' => sub { |
626 |
subtest 'UNIMARC' => sub { |
| 642 |
plan tests => 46; |
627 |
plan tests => 43; |
| 643 |
|
628 |
|
| 644 |
# Mock the auth type data for UNIMARC |
629 |
# Mock the auth type data for UNIMARC |
| 645 |
$dbh->do("UPDATE auth_types SET auth_tag_to_report = '106' WHERE auth_tag_to_report = '100'") or die $dbh->errstr; |
630 |
$dbh->do("UPDATE auth_types SET auth_tag_to_report = '106' WHERE auth_tag_to_report = '100'") or die $dbh->errstr; |
| 646 |
- |
|
|