Lines 702-708
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
702 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
702 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
703 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
703 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
704 |
|
704 |
|
705 |
my $notes = $biblio->get_marc_notes({ marcflavour => 'MARC21' }); |
705 |
my $notes = $biblio->get_marc_notes; |
706 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
706 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
707 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
707 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
708 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
708 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
Lines 710-716
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
710 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
710 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
711 |
is( $notes->[5]->{marcnote}, 'Description should show', 'Authorised value is correctly parsed to show description rather than code' ); |
711 |
is( $notes->[5]->{marcnote}, 'Description should show', 'Authorised value is correctly parsed to show description rather than code' ); |
712 |
is( @$notes, 6, 'No more notes' ); |
712 |
is( @$notes, 6, 'No more notes' ); |
713 |
$notes = $biblio->get_marc_notes({ marcflavour => 'MARC21', opac => 1 }); |
713 |
$notes = $biblio->get_marc_notes({ opac => 1 }); |
714 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
714 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
715 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
715 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
716 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
716 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
Lines 732-737
subtest 'get_marc_notes() UNIMARC tests' => sub {
Link Here
|
732 |
$schema->storage->txn_begin; |
732 |
$schema->storage->txn_begin; |
733 |
|
733 |
|
734 |
t::lib::Mocks::mock_preference( 'NotesToHide', '310' ); |
734 |
t::lib::Mocks::mock_preference( 'NotesToHide', '310' ); |
|
|
735 |
t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); |
735 |
|
736 |
|
736 |
my $biblio = $builder->build_sample_biblio; |
737 |
my $biblio = $builder->build_sample_biblio; |
737 |
my $record = $biblio->metadata->record; |
738 |
my $record = $biblio->metadata->record; |
Lines 747-752
subtest 'get_marc_notes() UNIMARC tests' => sub {
Link Here
|
747 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
748 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
748 |
is( @$notes, 2, 'No more notes' ); |
749 |
is( @$notes, 2, 'No more notes' ); |
749 |
|
750 |
|
|
|
751 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
750 |
$schema->storage->txn_rollback; |
752 |
$schema->storage->txn_rollback; |
751 |
}; |
753 |
}; |
752 |
|
754 |
|
753 |
- |
|
|