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

(-)a/t/db_dependent/Biblio.t (-1 / +23 lines)
Lines 645-651 subtest 'ModBiblio called from linker test' => sub { Link Here
645
};
645
};
646
646
647
subtest "LinkBibHeadingsToAuthorities record generation tests" => sub {
647
subtest "LinkBibHeadingsToAuthorities record generation tests" => sub {
648
    plan tests => 3;
648
    plan tests => 6;
649
649
650
    # Set up mocks to ensure authorities are generated
650
    # Set up mocks to ensure authorities are generated
651
    my $biblio_mod = Test::MockModule->new( 'C4::Linker::Default' );
651
    my $biblio_mod = Test::MockModule->new( 'C4::Linker::Default' );
Lines 679-684 subtest "LinkBibHeadingsToAuthorities record generation tests" => sub { Link Here
679
        "The generated record contains the correct subfields"
679
        "The generated record contains the correct subfields"
680
    );
680
    );
681
681
682
    # Example series link with volume and punctuation
683
    $record = MARC::Record->new();
684
    $field = MARC::Field->new('800','','','a' => 'Tolkien, J. R. R.', 'q' => '(John Ronald Reuel),', 'd' => '1892-1973.', 't' => 'Lord of the rings ;', 'v' => '1');
685
    $record->append_fields($field);
686
687
    ( $num_headings_changed, $results ) = LinkBibHeadingsToAuthorities($linker, $record, "",undef);
688
689
    is( $num_headings_changed, 1, 'We changed the one we passed' );
690
    is_deeply( $results->{added},
691
        {"Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings ;" => 1 },
692
        "We added an authority record for the heading"
693
    );
694
695
    # Now we check the authority record itself
696
    $authority = GetAuthority( $record->subfield('800','9') );
697
    is( $authority->field('100')->as_string(),
698
        "Tolkien, J. R. R. (John Ronald Reuel), 1892-1973. Lord of the rings",
699
        "The generated record contains the correct subfields"
700
    );
701
702
703
682
};
704
};
683
705
684
# Cleanup
706
# Cleanup
(-)a/t/db_dependent/Heading_MARC21.t (-2 / +7 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
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
22
}
28
}
23
- 

Return to bug 24094