Lines 679-685
subtest 'subscriptions() tests' => sub {
Link Here
|
679 |
}; |
679 |
}; |
680 |
|
680 |
|
681 |
subtest 'get_marc_notes() MARC21 tests' => sub { |
681 |
subtest 'get_marc_notes() MARC21 tests' => sub { |
682 |
plan tests => 13; |
682 |
plan tests => 14; |
683 |
|
683 |
|
684 |
$schema->storage->txn_begin; |
684 |
$schema->storage->txn_begin; |
685 |
|
685 |
|
Lines 692-706
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
692 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
692 |
MARC::Field->new( '505', '', '', a => 'Note2', u => 'http://someserver.com' ), |
693 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
693 |
MARC::Field->new( '520', '', '', a => 'Note3 skipped' ), |
694 |
MARC::Field->new( '541', '0', '', a => 'Note4 skipped on opac' ), |
694 |
MARC::Field->new( '541', '0', '', a => 'Note4 skipped on opac' ), |
695 |
MARC::Field->new( '541', '', '', a => 'Note5' ), |
695 |
MARC::Field->new( '544', '', '', a => 'Note5' ), |
696 |
MARC::Field->new( '590', '', '', a => 'CODE' ), |
696 |
MARC::Field->new( '590', '', '', a => 'CODE' ), |
|
|
697 |
MARC::Field->new( '545', '', '', a => 'Invisible on OPAC' ), |
697 |
); |
698 |
); |
698 |
|
699 |
|
699 |
Koha::AuthorisedValueCategory->new({ category_name => 'TEST' })->store; |
700 |
Koha::AuthorisedValueCategory->new({ category_name => 'TEST' })->store; |
700 |
Koha::AuthorisedValue->new({ category => 'TEST', authorised_value => 'CODE', lib => 'Description should show', lib_opac => 'Description should show OPAC' })->store; |
701 |
Koha::AuthorisedValue->new( |
|
|
702 |
{ |
703 |
category => 'TEST', |
704 |
authorised_value => 'CODE', |
705 |
lib => 'Description should show', |
706 |
lib_opac => 'Description should show OPAC' |
707 |
} |
708 |
)->store; |
701 |
my $mss = Koha::MarcSubfieldStructures->find({tagfield => "590", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
709 |
my $mss = Koha::MarcSubfieldStructures->find({tagfield => "590", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
702 |
$mss->update({ authorised_value => "TEST" }); |
710 |
$mss->update({ authorised_value => "TEST" }); |
703 |
|
711 |
|
|
|
712 |
$mss = Koha::MarcSubfieldStructures->find({tagfield => "545", tagsubfield => "a", frameworkcode => $biblio->frameworkcode }); |
713 |
$mss->update({ hidden => 1 }); |
714 |
|
704 |
my $cache = Koha::Caches->get_instance; |
715 |
my $cache = Koha::Caches->get_instance; |
705 |
$cache->clear_from_cache("MarcStructure-0-"); |
716 |
$cache->clear_from_cache("MarcStructure-0-"); |
706 |
$cache->clear_from_cache("MarcStructure-1-"); |
717 |
$cache->clear_from_cache("MarcStructure-1-"); |
Lines 714-723
subtest 'get_marc_notes() MARC21 tests' => sub {
Link Here
|
714 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
725 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
715 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
726 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
716 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
727 |
is( $notes->[2]->{marcnote}, 'http://someserver.com', 'URL separated' ); |
717 |
is( $notes->[3]->{marcnote}, 'Note4 skipped on opac',"Not shows if not opac" ); |
728 |
is( $notes->[3]->{marcnote}, 'Note4 skipped on opac',"Note shows if not opac (Hidden by Indicator)" ); |
718 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
729 |
is( $notes->[4]->{marcnote}, 'Note5', 'Fifth note' ); |
719 |
is( $notes->[5]->{marcnote}, 'Description should show', 'Authorised value is correctly parsed to show description rather than code' ); |
730 |
is( $notes->[5]->{marcnote}, 'Description should show', 'Authorised value is correctly parsed to show description rather than code' ); |
720 |
is( @$notes, 6, 'No more notes' ); |
731 |
is( $notes->[6]->{marcnote}, 'Invisible on OPAC', 'Note shows if not opac (Hidden by framework)' ); |
|
|
732 |
is( @$notes, 7, 'No more notes' ); |
721 |
$notes = $biblio->get_marc_notes({ opac => 1 }); |
733 |
$notes = $biblio->get_marc_notes({ opac => 1 }); |
722 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
734 |
is( $notes->[0]->{marcnote}, 'Note1', 'First note' ); |
723 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
735 |
is( $notes->[1]->{marcnote}, 'Note2', 'Second note' ); |
724 |
- |
|
|