From d3ebcb37f0c87badfb56a1c5b3a876281c69915e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 11 Feb 2020 16:44:07 +0100 Subject: [PATCH] Bug 8643: Fix IsMarcStructureInternal tests --- C4/Biblio.pm | 2 +- t/db_dependent/Biblio.t | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 700dc1cb77..aa401d5646 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -824,7 +824,7 @@ sub GetISBDView { # Process subfield } -GetMarcStructure creates keys (lib, tab, mandatory, repeatable) for a display purpose. +GetMarcStructure creates keys (lib, tab, mandatory, repeatable, important) for a display purpose. These different values should not be processed as valid subfields. =cut diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index cc38e07201..ab1553b81c 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -554,7 +554,7 @@ subtest 'NORMARC' => sub { }; subtest 'IsMarcStructureInternal' => sub { - plan tests => 8; + plan tests => 9; my $tagslib = GetMarcStructure(); my @internals; for my $tag ( sort keys %$tagslib ) { @@ -564,11 +564,12 @@ subtest 'IsMarcStructureInternal' => sub { } } @internals = uniq @internals; - is( scalar(@internals), 6, 'expect 6 internals'); + is( scalar(@internals), 7, 'expect 7 internals'); is( grep( /^lib$/, @internals ), 1, 'check lib' ); is( grep( /^tab$/, @internals ), 1, 'check tab' ); is( grep( /^mandatory$/, @internals ), 1, 'check mandatory' ); is( grep( /^repeatable$/, @internals ), 1, 'check repeatable' ); + is( grep( /^important$/, @internals ), 1, 'check important' ); is( grep( /^a$/, @internals ), 0, 'no subfield a' ); is( grep( /^ind1_defaultvalue$/, @internals ), 1, 'check indicator 1 default value' ); is( grep( /^ind2_defaultvalue$/, @internals ), 1, 'check indicator 2 default value' ); -- 2.11.0