|
Lines 274-281
subtest "_batchCommitItems" => sub {
Link Here
|
| 274 |
'Error correctly set when import item has duplicate barcode and action always_add' |
274 |
'Error correctly set when import item has duplicate barcode and action always_add' |
| 275 |
); |
275 |
); |
| 276 |
|
276 |
|
| 277 |
$import_item = $builder->build_object({ class => 'Koha::Import::Record::Items', value => { |
277 |
$import_item = $builder->build_object( |
| 278 |
marcxml => q{<?xml version="1.0" encoding="UTF-8"?> |
278 |
{ |
|
|
279 |
class => 'Koha::Import::Record::Items', |
| 280 |
value => { |
| 281 |
marcxml => q{<?xml version="1.0" encoding="UTF-8"?> |
| 279 |
<collection |
282 |
<collection |
| 280 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
283 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 281 |
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" |
284 |
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" |
|
Lines 293-306
subtest "_batchCommitItems" => sub {
Link Here
|
| 293 |
</record> |
296 |
</record> |
| 294 |
</collection> |
297 |
</collection> |
| 295 |
}, |
298 |
}, |
| 296 |
}}); |
299 |
} |
|
|
300 |
} |
| 301 |
); |
| 297 |
|
302 |
|
| 298 |
( $num_items_added, $num_items_replaced, $num_items_errored ) = |
303 |
( $num_items_added, $num_items_replaced, $num_items_errored ) = |
| 299 |
C4::ImportBatch::_batchCommitItems( $import_item->import_record_id, 32, 'always_add',64 ); |
304 |
C4::ImportBatch::_batchCommitItems( $import_item->import_record_id, 32, 'always_add', 64 ); |
| 300 |
is( $num_items_errored, 1, "Item with wrong branchcode fails when action always_add" ); |
305 |
is( $num_items_errored, 1, "Item with wrong branchcode fails when action always_add" ); |
| 301 |
$import_item->discard_changes(); |
306 |
$import_item->discard_changes(); |
| 302 |
is( $import_item->status, 'error', "Import item marked as error when wrong branchcode detected and action always_add"); |
307 |
is( |
| 303 |
is( $import_item->import_error, 'Branch code WBRC missing', 'Error correctly set when import item has a wrong branchcode detected and action always_add' ); |
308 |
$import_item->status, 'error', |
|
|
309 |
"Import item marked as error when wrong branchcode detected and action always_add" |
| 310 |
); |
| 311 |
is( |
| 312 |
$import_item->import_error, 'Branch code WBRC missing', |
| 313 |
'Error correctly set when import item has a wrong branchcode detected and action always_add' |
| 314 |
); |
| 304 |
}; |
315 |
}; |
| 305 |
|
316 |
|
| 306 |
subtest "RecordsFromMarcPlugin" => sub { |
317 |
subtest "RecordsFromMarcPlugin" => sub { |