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 315-318
subtest 'GetMarcSubfieldStructureFromKohaField' => sub {
Link Here
|
315 |
is($marc_subfield_structure, undef, "invalid kohafield returns undef"); |
316 |
is($marc_subfield_structure, undef, "invalid kohafield returns undef"); |
316 |
}; |
317 |
}; |
317 |
|
318 |
|
|
|
319 |
subtest 'IsMarcStructureInternal' => sub { |
320 |
plan tests => 6; |
321 |
my $tagslib = GetMarcStructure(); |
322 |
my @internals; |
323 |
for my $tag ( sort keys %$tagslib ) { |
324 |
next unless $tag; |
325 |
for my $subfield ( sort keys %{ $tagslib->{$tag} } ) { |
326 |
push @internals, $subfield if IsMarcStructureInternal($tagslib->{$tag}{$subfield}); |
327 |
} |
328 |
} |
329 |
@internals = uniq @internals; |
330 |
is( scalar(@internals), 4, ''); |
331 |
is( grep( /^lib$/, @internals ), 1, '' ); |
332 |
is( grep( /^tab$/, @internals ), 1, '' ); |
333 |
is( grep( /^mandatory$/, @internals ), 1, '' ); |
334 |
is( grep( /^repeatable$/, @internals ), 1, '' ); |
335 |
is( grep( /^a$/, @internals ), 0, '' ); |
336 |
}; |
337 |
|
318 |
1; |
338 |
1; |