Lines 26-32
use MARC::Record;
Link Here
|
26 |
use C4::Biblio; |
26 |
use C4::Biblio; |
27 |
|
27 |
|
28 |
subtest 'GetMarcNotes MARC21' => sub { |
28 |
subtest 'GetMarcNotes MARC21' => sub { |
29 |
plan tests => 4; |
29 |
plan tests => 11; |
30 |
t::lib::Mocks::mock_preference( 'NotesBlacklist', '520' ); |
30 |
t::lib::Mocks::mock_preference( 'NotesBlacklist', '520' ); |
31 |
|
31 |
|
32 |
my $record = MARC::Record->new; |
32 |
my $record = MARC::Record->new; |
Lines 34-45
subtest 'GetMarcNotes MARC21' => sub {
Link Here
|
34 |
MARC::Field->new( '500', '', '', a => 'Note1' ), |
34 |
MARC::Field->new( '500', '', '', a => 'Note1' ), |
35 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
35 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
36 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
36 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
|
|
37 |
MARC::Field->new( '541', '0', '', a => 'Note4 skipped on opac' ), |
38 |
MARC::Field->new( '541', '', '', a => 'Note5' ), |
37 |
); |
39 |
); |
38 |
my $notes = C4::Biblio::GetMarcNotes( $record, 'MARC21' ); |
40 |
my $notes = C4::Biblio::GetMarcNotes( $record, 'MARC21' ); |
39 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
41 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
40 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
42 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
41 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
43 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
42 |
is( @$notes, 3, 'No more notes' ); |
44 |
is( $notes->[3]->{marcnote}, 'Note4 skipped on opac',"Not shows if not opac" ); |
|
|
45 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
46 |
is( @$notes, 5, 'No more notes' ); |
47 |
$notes = C4::Biblio::GetMarcNotes( $record, 'MARC21', 1 ); |
48 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
49 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
50 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
51 |
is( $notes->[3]->{marcnote}, 'Note5', 'Fifth note shows after fourth skipped' ); |
52 |
is( @$notes, 4, 'No more notes' ); |
53 |
|
43 |
}; |
54 |
}; |
44 |
|
55 |
|
45 |
subtest 'GetMarcNotes UNIMARC' => sub { |
56 |
subtest 'GetMarcNotes UNIMARC' => sub { |
46 |
- |
|
|