Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 10; |
20 |
use Test::More tests => 11; |
21 |
|
21 |
|
22 |
use Koha::SearchEngine::Elasticsearch::QueryBuilder; |
22 |
use Koha::SearchEngine::Elasticsearch::QueryBuilder; |
23 |
|
23 |
|
Lines 57-60
SKIP: {
Link Here
|
57 |
|
57 |
|
58 |
} |
58 |
} |
59 |
|
59 |
|
|
|
60 |
subtest 'json2marc' => sub { |
61 |
plan tests => 4; |
62 |
my $leader = '00626nam a2200193 4500'; |
63 |
my $_001 = 42; |
64 |
my $_010a = '123456789'; |
65 |
my $_010d = 145; |
66 |
my $_200a = 'a title'; |
67 |
my $json = [ # It's not a JSON, see the POD of json2marc |
68 |
[ 'LDR', undef, undef, '_', $leader ], |
69 |
[ '001', undef, undef, '_', $_001 ], |
70 |
[ '010', ' ', ' ', 'a', $_010a, 'd', $_010d ], |
71 |
[ '200', '1', ' ', 'a', $_200a, ], # Yes UNIMARC but we don't mind here |
72 |
]; |
73 |
|
74 |
my $marc = $searcher->json2marc( $json ); |
75 |
is( $marc->leader, $leader, ); |
76 |
is( $marc->field('001')->data, $_001, ); |
77 |
is( $marc->subfield('010', 'a'), $_010a, ); |
78 |
is( $marc->subfield('200', 'a'), $_200a, ); |
79 |
|
80 |
}; |
81 |
|
60 |
1; |
82 |
1; |
61 |
- |
|
|