Lines 36-42
my $builder = t::lib::TestBuilder->new;
Link Here
|
36 |
my $logger = t::lib::Mocks::Logger->new(); |
36 |
my $logger = t::lib::Mocks::Logger->new(); |
37 |
|
37 |
|
38 |
subtest 'process_quote' => sub { |
38 |
subtest 'process_quote' => sub { |
39 |
plan tests => 7; |
39 |
plan tests => 16; |
40 |
|
40 |
|
41 |
$schema->storage->txn_begin; |
41 |
$schema->storage->txn_begin; |
42 |
|
42 |
|
Lines 93-103
subtest 'process_quote' => sub {
Link Here
|
93 |
} |
93 |
} |
94 |
); |
94 |
); |
95 |
|
95 |
|
|
|
96 |
t::lib::Mocks::mock_preference( 'CataloguingLog', 0 ); |
97 |
|
96 |
# Process the test quote file |
98 |
# Process the test quote file |
97 |
process_quote($quote); |
99 |
my $error; |
|
|
100 |
eval { |
101 |
process_quote($quote); |
102 |
1; |
103 |
} or do { |
104 |
$error = $@; |
105 |
}; |
106 |
ok( !$error, 'process_quote completed without dying' ); |
98 |
|
107 |
|
99 |
# Test for expected warnings for the passed quote file |
108 |
# Test for expected warnings for the passed quote file |
100 |
# |
109 |
is( $logger->count, 8, "8 log lines recorded for passed quote file" ); |
|
|
110 |
|
111 |
#$logger->diag(); |
112 |
$logger->trace_like( |
113 |
qr/Created basket:.*/, |
114 |
"Trace recorded adding basket" |
115 |
)->trace_like( |
116 |
qr/Checking db for matches.*/, |
117 |
"Trace recorded checking db for matches" |
118 |
)->trace_like( |
119 |
qr/New biblio added.*/, |
120 |
"Trace recoded adding new biblio" |
121 |
)->trace_like( |
122 |
qr/Order created:.*/, |
123 |
"Trace recorded adding order" |
124 |
)->trace_like( |
125 |
qr/Added item:.*/, |
126 |
"Trace recorded adding new item" |
127 |
)->trace_like( |
128 |
qr/Item added to rota.*/, |
129 |
"Trace recrded adding item to rota" |
130 |
)->debug_like( |
131 |
qr/.*specialUpdate biblioserver$/, |
132 |
"Trace recorded biblioserver index" |
133 |
)->clear(); |
134 |
|
101 |
# Test for quote status change |
135 |
# Test for quote status change |
102 |
$quote->get_from_storage; |
136 |
$quote->get_from_storage; |
103 |
is( $quote->status, 'received', 'Quote status was set to received' ); |
137 |
is( $quote->status, 'received', 'Quote status was set to received' ); |
Lines 294-300
subtest '_handle_008_field' => sub {
Link Here
|
294 |
}; |
328 |
}; |
295 |
|
329 |
|
296 |
subtest 'process_invoice' => sub { |
330 |
subtest 'process_invoice' => sub { |
297 |
plan tests => 12; |
331 |
plan tests => 19; |
298 |
|
332 |
|
299 |
$schema->storage->txn_begin; |
333 |
$schema->storage->txn_begin; |
300 |
|
334 |
|
Lines 372-377
subtest 'process_invoice' => sub {
Link Here
|
372 |
}; |
406 |
}; |
373 |
ok( !$error, 'process_invoice completed without dying' ); |
407 |
ok( !$error, 'process_invoice completed without dying' ); |
374 |
|
408 |
|
|
|
409 |
is( $logger->count, 14, "14 log lines recorded for passed invoice file" ); |
410 |
|
411 |
#$logger->diag(); |
375 |
$logger->trace_like( |
412 |
$logger->trace_like( |
376 |
qr/Adding invoice:.*/, |
413 |
qr/Adding invoice:.*/, |
377 |
"Trace recorded adding invoice" |
414 |
"Trace recorded adding invoice" |
Lines 380-401
subtest 'process_invoice' => sub {
Link Here
|
380 |
"Trace recorded invoice added" |
417 |
"Trace recorded invoice added" |
381 |
)->error_is( |
418 |
)->error_is( |
382 |
'Skipping invoice line, no associated ordernumber', |
419 |
'Skipping invoice line, no associated ordernumber', |
383 |
"Received expected log line for missing ordernumber line" |
420 |
"Error recorded for missing ordernumber line" |
384 |
)->error_like( |
421 |
)->error_like( |
385 |
qr/Skipping invoice line, no order found for.*/, |
422 |
qr/Skipping invoice line, no order found for.*/, |
386 |
'Received expected log line for unmatched ordernumber line' |
423 |
'Error recorded for unmatched ordernumber line' |
387 |
)->error_like( |
424 |
)->error_like( |
388 |
qr/Skipping invoice line, no bibliographic.*/, |
425 |
qr/Skipping invoice line, no bibliographic.*/, |
389 |
'Received expected log line for unmatched biblionumber line' |
426 |
'Error recorded for unmatched biblionumber line' |
390 |
)->trace_like( |
427 |
)->trace_like( |
391 |
qr/Receipting order:.*/, |
428 |
qr/Receipting order:.*/, |
392 |
'Trace recorded invoice receipted' |
429 |
'Trace recorded invoice receipted' |
393 |
)->trace_like( |
430 |
)->trace_like( |
394 |
qr/Updating bib:.*/, |
431 |
qr/Updating bib:.*/, |
395 |
'Trace recorded bib updated' |
432 |
'Trace recorded bib updated' |
|
|
433 |
)->trace_like( |
434 |
qr/Receipting order:.*/, |
435 |
'Trace recorded invoice receipted - Check why this happens a second time' |
436 |
)->trace_like( |
437 |
qr/Updating bib:.*/, |
438 |
'Trace recorded bib updated - same bib, different id' |
396 |
)->error_like( |
439 |
)->error_like( |
397 |
qr/Cannot find vendor with ean.*/, |
440 |
qr/Cannot find vendor with ean.*/, |
398 |
'Received expected log line for missing ean' |
441 |
'Error recorded for missing ean' |
|
|
442 |
)->warn_like( |
443 |
qr/transferring.*/, |
444 |
'Warn recorded for transferring items' |
445 |
)->warn_like( |
446 |
qr/Unmatched item at branch:.*/, |
447 |
'Warn recorded for unmatched item' |
448 |
)->warn_like( |
449 |
qr/transferring.*/, |
450 |
'Warn recorded for transferring items' |
451 |
)->warn_like( |
452 |
qr/Unmatched item at branch:.*/, |
453 |
'Warn recorded for unmatched item' |
399 |
)->clear(); |
454 |
)->clear(); |
400 |
|
455 |
|
401 |
my $invoice3 = Koha::Acquisition::Invoices->search( { invoicenumber => 'INV00003' }, { rows => 1 } )->single; |
456 |
my $invoice3 = Koha::Acquisition::Invoices->search( { invoicenumber => 'INV00003' }, { rows => 1 } )->single; |
402 |
- |
|
|