Lines 668-674
subtest 'subscriptions() tests' => sub {
Link Here
|
668 |
}; |
668 |
}; |
669 |
|
669 |
|
670 |
subtest 'get_marc_notes() MARC21 tests' => sub { |
670 |
subtest 'get_marc_notes() MARC21 tests' => sub { |
671 |
plan tests => 13; |
671 |
plan tests => 14; |
672 |
|
672 |
|
673 |
$schema->storage->txn_begin; |
673 |
$schema->storage->txn_begin; |
674 |
|
674 |
|
Lines 681-695
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
681 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
681 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
682 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
682 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
683 |
MARC::Field->new( '541', '0', '', a => 'Note4 skipped on opac' ), |
683 |
MARC::Field->new( '541', '0', '', a => 'Note4 skipped on opac' ), |
684 |
MARC::Field->new( '541', '', '', a => 'Note5' ), |
684 |
MARC::Field->new( '544', '', '', a => 'Note5' ), |
685 |
MARC::Field->new( '590', '', '', a => 'CODE' ), |
685 |
MARC::Field->new( '590', '', '', a => 'CODE' ), |
|
|
686 |
MARC::Field->new( '545', '', '', a => 'Invisible on OPAC' ), |
686 |
); |
687 |
); |
687 |
|
688 |
|
688 |
Koha::AuthorisedValueCategory->new({ category_name => 'TEST' })->store; |
689 |
Koha::AuthorisedValueCategory->new({ category_name => 'TEST' })->store; |
689 |
Koha::AuthorisedValue->new({ category => 'TEST', authorised_value => 'CODE', lib => 'Description should show', lib_opac => 'Description should show OPAC' })->store; |
690 |
Koha::AuthorisedValue->new( |
|
|
691 |
{ |
692 |
category => 'TEST', |
693 |
authorised_value => 'CODE', |
694 |
lib => 'Description should show', |
695 |
lib_opac => 'Description should show OPAC' |
696 |
} |
697 |
)->store; |
690 |
my $mss = Koha::MarcSubfieldStructures->find({tagfield => "590", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
698 |
my $mss = Koha::MarcSubfieldStructures->find({tagfield => "590", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
691 |
$mss->update({ authorised_value => "TEST" }); |
699 |
$mss->update({ authorised_value => "TEST" }); |
692 |
|
700 |
|
|
|
701 |
$mss = Koha::MarcSubfieldStructures->find({tagfield => "545", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
702 |
$mss->update({ hidden => 1 }); |
703 |
|
693 |
my $cache = Koha::Caches->get_instance; |
704 |
my $cache = Koha::Caches->get_instance; |
694 |
$cache->clear_from_cache("MarcStructure-0-"); |
705 |
$cache->clear_from_cache("MarcStructure-0-"); |
695 |
$cache->clear_from_cache("MarcStructure-1-"); |
706 |
$cache->clear_from_cache("MarcStructure-1-"); |
Lines 703-712
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
703 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
714 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
704 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
715 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
705 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
716 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
706 |
is( $notes->[3]->{marcnote}, 'Note4 skipped on opac',"Not shows if not opac" ); |
717 |
is( $notes->[3]->{marcnote}, 'Note4 skipped on opac',"Note shows if not opac (Hidden by Indicator)" ); |
707 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
718 |
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' ); |
719 |
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' ); |
720 |
is( $notes->[6]->{marcnote}, 'Invisible on OPAC', 'Note shows if not opac (Hidden by framework)' ); |
|
|
721 |
is( @$notes, 7, 'No more notes' ); |
710 |
$notes = $biblio->get_marc_notes({ opac => 1 }); |
722 |
$notes = $biblio->get_marc_notes({ opac => 1 }); |
711 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
723 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
712 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
724 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
713 |
- |
|
|