Lines 52-71
sub _koha_marc_update_bib_ids_control {
Link Here
|
52 |
is($r->field('004')->data(), 20, 'Biblioitemnumber to control field'); |
52 |
is($r->field('004')->data(), 20, 'Biblioitemnumber to control field'); |
53 |
} |
53 |
} |
54 |
|
54 |
|
55 |
subtest 'SplitSubtitle' => sub { |
55 |
subtest 'SplitKohaField' => sub { |
56 |
plan tests => 4; |
56 |
plan tests => 4; |
57 |
|
57 |
|
58 |
my $res = C4::Biblio::SplitSubtitle(undef); |
58 |
my $res = C4::Biblio::SplitKohaField(undef); |
59 |
is_deeply($res, [], 'undef returned as an array'); |
59 |
is_deeply($res, [], 'undef returned as an array'); |
60 |
|
60 |
|
61 |
$res = C4::Biblio::SplitSubtitle(''); |
61 |
$res = C4::Biblio::SplitKohaField(''); |
62 |
is_deeply($res, [], 'Empty string returned as an array'); |
62 |
is_deeply($res, [], 'Empty string returned as an array'); |
63 |
|
63 |
|
64 |
$res = C4::Biblio::SplitSubtitle('Single'); |
64 |
$res = C4::Biblio::SplitKohaField('Single'); |
65 |
is_deeply($res, [{'subfield' => 'Single'}], 'Single subtitle returns an array'); |
65 |
is_deeply($res, ['Single'], 'Single subtitle returned as an array'); |
66 |
|
66 |
|
67 |
$res = C4::Biblio::SplitSubtitle('First | Second'); |
67 |
$res = C4::Biblio::SplitKohaField('First | Second'); |
68 |
is_deeply($res, [{'subfield' => 'First'}, {'subfield' => 'Second'}], 'Two subtitles returns an array'); |
68 |
is_deeply($res, ['First', 'Second'], 'Two subtitles returned as an array'); |
69 |
}; |
69 |
}; |
70 |
|
70 |
|
71 |
done_testing(); |
71 |
done_testing(); |