Lines 17-25
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 5; |
20 |
use Test::More tests => 6; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
|
22 |
|
|
|
23 |
use List::MoreUtils qw( uniq ); |
23 |
use MARC::Record; |
24 |
use MARC::Record; |
24 |
use t::lib::Mocks qw( mock_preference ); |
25 |
use t::lib::Mocks qw( mock_preference ); |
25 |
|
26 |
|
Lines 323-326
subtest 'GetMarcSubfieldStructureFromKohaField' => sub {
Link Here
|
323 |
is($marc_subfield_structure, undef, "invalid kohafield returns undef"); |
324 |
is($marc_subfield_structure, undef, "invalid kohafield returns undef"); |
324 |
}; |
325 |
}; |
325 |
|
326 |
|
|
|
327 |
subtest 'IsMarcStructureInternal' => sub { |
328 |
plan tests => 6; |
329 |
my $tagslib = GetMarcStructure(); |
330 |
my @internals; |
331 |
for my $tag ( sort keys %$tagslib ) { |
332 |
next unless $tag; |
333 |
for my $subfield ( sort keys %{ $tagslib->{$tag} } ) { |
334 |
push @internals, $subfield if IsMarcStructureInternal($tagslib->{$tag}{$subfield}); |
335 |
} |
336 |
} |
337 |
@internals = uniq @internals; |
338 |
is( scalar(@internals), 4, ''); |
339 |
is( grep( /^lib$/, @internals ), 1, '' ); |
340 |
is( grep( /^tab$/, @internals ), 1, '' ); |
341 |
is( grep( /^mandatory$/, @internals ), 1, '' ); |
342 |
is( grep( /^repeatable$/, @internals ), 1, '' ); |
343 |
is( grep( /^a$/, @internals ), 0, '' ); |
344 |
}; |
345 |
|
326 |
1; |
346 |
1; |