View | Details | Raw Unified | Return to bug 24094
Collapse All | Expand All

(-)a/t/db_dependent/Biblio.t (-1 / +23 lines)
Lines 644-650 subtest 'ModBiblio called from linker test' => sub { Link Here
644
};
644
};
645
645
646
subtest "LinkBibHeadingsToAuthorities record generation tests" => sub {
646
subtest "LinkBibHeadingsToAuthorities record generation tests" => sub {
647
    plan tests => 3;
647
    plan tests => 6;
648
648
649
    # Set up mocks to ensure authorities are generated
649
    # Set up mocks to ensure authorities are generated
650
    my $biblio_mod = Test::MockModule->new( 'C4::Linker::Default' );
650
    my $biblio_mod = Test::MockModule->new( 'C4::Linker::Default' );
Lines 678-683 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
678
        "The generated record contains the correct subfields"
678
        "The generated record contains the correct subfields"
679
    );
679
    );
680
680
681
    # Example series link with volume and punctuation
682
    $record = MARC::Record->new();
683
    $field = MARC::Field->new('800','','','a' => 'Tolkien, J. R. R.', 'q' => '(John Ronald Reuel),', 'd' => '1892-1973.', 't' => 'Lord of the rings ;', 'v' => '1');
684
    $record->append_fields($field);
685
686
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef);
687
688
    is( $num_headings_changed, 1, 'We changed the one we passed' );
689
    is_deeply( $results->{added},
690
        {"Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings ;" => 1 },
691
        "We added an authority record for the heading"
692
    );
693
694
    # Now we check the authority record itself
695
    $authority = GetAuthority( $record->subfield('800','9') );
696
    is( $authority->field('100')->as_string(),
697
        "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
698
        "The generated record contains the correct subfields"
699
    );
700
701
702
681
};
703
};
682
704
683
# Cleanup
705
# Cleanup
(-)a/t/db_dependent/Heading_MARC21.t (-3 / +8 lines)
Lines 6-12 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 3;
9
use Test::More tests => 5;
10
use C4::Context;
10
use C4::Context;
11
11
12
BEGIN {
12
BEGIN {
Lines 19-22 SKIP: { Link Here
19
    my $heading = C4::Heading->new_from_bib_field($field);
19
    my $heading = C4::Heading->new_from_bib_field($field);
20
    is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
20
    is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
21
    is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');
21
    is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');
22
}
22
23
    $field = MARC::Field->new( '830', ' ', '4', a => 'The dark is rising ;', v => '3' );
24
    $heading = C4::Heading->new_from_bib_field($field);
25
    is($heading->display_form(), 'The dark is rising ;', 'Display form generation');
26
    is($heading->search_form(), 'The dark is rising', 'Search form generation');
27
28
} 
23
- 

Return to bug 24094