Lines 19-24
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use Test::More tests => 7; |
20 |
use Test::More tests => 7; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
|
|
22 |
use Test::Warn; |
22 |
|
23 |
|
23 |
use Koha::Database; |
24 |
use Koha::Database; |
24 |
use Koha::BackgroundJobs; |
25 |
use Koha::BackgroundJobs; |
Lines 76-82
subtest 'format_title' => sub {
Link Here
|
76 |
|
77 |
|
77 |
subtest 'read_file' => sub { |
78 |
subtest 'read_file' => sub { |
78 |
|
79 |
|
79 |
plan tests => 6; |
80 |
plan tests => 7; |
80 |
|
81 |
|
81 |
my $file = { |
82 |
my $file = { |
82 |
filename => 'Test_file.csv', |
83 |
filename => 'Test_file.csv', |
Lines 112-117
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bb
Link Here
|
112 |
'Line correctly identified' |
113 |
'Line correctly identified' |
113 |
); |
114 |
); |
114 |
|
115 |
|
|
|
116 |
my $file2 = { |
117 |
filename => 'Test_file2.csv', |
118 |
file_content => encode_base64( |
119 |
"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 |
120 |
Nature Plants,,2055-0278,2015-01,1,1,,,,https://www.nature.com/nplants,,4aaa7,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P,\"foo\"bar |
121 |
Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P" |
122 |
) |
123 |
}; |
124 |
warning_is { |
125 |
Koha::BackgroundJob::ImportKBARTFile::read_file($file2); |
126 |
} |
127 |
'2023, EIQ - QUO character not allowed, 157', 'Error message correctly reported'; |
115 |
}; |
128 |
}; |
116 |
|
129 |
|
117 |
subtest 'create_title_hash_from_line_data' => sub { |
130 |
subtest 'create_title_hash_from_line_data' => sub { |
118 |
- |
|
|