View | Details | Raw Unified | Return to bug 38689
Collapse All | Expand All

(-)a/t/db_dependent/Koha/EDI.t (-10 / +20 lines)
Lines 294-300 subtest '_handle_008_field' => sub { Link Here
294
};
294
};
295
295
296
subtest 'process_invoice' => sub {
296
subtest 'process_invoice' => sub {
297
    plan tests => 11;
297
    plan tests => 12;
298
298
299
    $schema->storage->txn_begin;
299
    $schema->storage->txn_begin;
300
300
Lines 363-376 subtest 'process_invoice' => sub { Link Here
363
    $invoice_message->update( { raw_msg => $raw_msg } );
363
    $invoice_message->update( { raw_msg => $raw_msg } );
364
364
365
    # Process the test invoice file
365
    # Process the test invoice file
366
    warnings_exist { process_invoice($invoice_message) }
366
    my $error;
367
    [
367
    eval {
368
        { carped => qr/Cannot find vendor with ean.*/i },
368
        process_invoice($invoice_message);
369
    ],
369
        1;
370
        'Invoice processed, with warnings, without dieing';
370
    } or do {
371
371
        $error = $@;
372
    $logger->trace_like( qr/Adding invoice:.*/, "Trace recorded adding invoice" )
372
    };
373
        ->trace_like( qr/Added as invoiceno.*/, "Trace recorded invoice added" )->error_is(
373
    ok( !$error, 'process_invoice completed without dying' );
374
375
    $logger->trace_like(
376
        qr/Adding invoice:.*/,
377
        "Trace recorded adding invoice"
378
    )->trace_like(
379
        qr/Added as invoiceno.*/,
380
        "Trace recorded invoice added"
381
    )->error_is(
374
        'Skipping invoice line, no associated ordernumber',
382
        'Skipping invoice line, no associated ordernumber',
375
        "Received expected log line for missing ordernumber line"
383
        "Received expected log line for missing ordernumber line"
376
    )->error_like(
384
    )->error_like(
Lines 385-390 subtest 'process_invoice' => sub { Link Here
385
    )->trace_like(
393
    )->trace_like(
386
        qr/Updating bib:.*/,
394
        qr/Updating bib:.*/,
387
        'Trace recorded bib updated'
395
        'Trace recorded bib updated'
396
    )->error_like(
397
        qr/Cannot find vendor with ean.*/,
398
        'Received expected log line for missing ean'
388
    )->clear();
399
    )->clear();
389
400
390
    my $invoice3 = Koha::Acquisition::Invoices->search( { invoicenumber => 'INV00003' }, { rows => 1 } )->single;
401
    my $invoice3 = Koha::Acquisition::Invoices->search( { invoicenumber => 'INV00003' }, { rows => 1 } )->single;
391
- 

Return to bug 38689