Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 7; |
20 |
use Test::More tests => 8; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
|
22 |
|
23 |
use Koha::Database; |
23 |
use Koha::Database; |
Lines 111-117
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bb
Link Here
|
111 |
], |
111 |
], |
112 |
'Line correctly identified' |
112 |
'Line correctly identified' |
113 |
); |
113 |
); |
|
|
114 |
}; |
115 |
|
116 |
subtest 'identify_delimiter' => sub { |
117 |
|
118 |
plan tests => 1; |
119 |
|
120 |
my $file = { |
121 |
filename => 'Test_file.txt', |
122 |
file_content => encode_base64( |
123 |
'publication_title,print_identifier,online_identifier,date_first_issue_online,num_first_vol_online,num_first_issue_online,date_last_issue_online,num_last_vol_online,num_last_issue_online,title_url,first_author,title_id,embargo_info,coverage_depth,coverage_notes,publisher_name,publication_type,date_monograph_published_print,date_monograph_published_online,monograph_volume,monograph_edition,first_editor,parent_publication_title_id,preceding_publication_title_id,access_type |
124 |
Nature Plants,,2055-0278,2015-01,1,1,,,,https://www.nature.com/nplants,,4aaa7,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P |
125 |
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P' |
126 |
) |
127 |
}; |
114 |
|
128 |
|
|
|
129 |
my $delimiter = Koha::BackgroundJob::ImportKBARTFile::identify_delimiter($file); |
130 |
is($delimiter, ',', 'Comma delimiter identified'); |
115 |
}; |
131 |
}; |
116 |
|
132 |
|
117 |
subtest 'create_title_hash_from_line_data' => sub { |
133 |
subtest 'create_title_hash_from_line_data' => sub { |
118 |
- |
|
|