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