Bugzilla – Attachment 176132 Details for
Bug 38689
EDIFACT errors should log to a staff accessible location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38689: Update unit test
Bug-38689-Update-unit-test.patch (text/plain), 2.23 KB, created by
Martin Renvoize (ashimema)
on 2025-01-03 16:35:43 UTC
(
hide
)
Description:
Bug 38689: Update unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-01-03 16:35:43 UTC
Size:
2.23 KB
patch
obsolete
>From cec1eeb38f77efa36e65c1e963935335a70354ee Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 20 Dec 2024 09:35:58 +0000 >Subject: [PATCH] Bug 38689: Update unit test > >We switch out the carp for a logger call in process_invoice, so we need >ot update the unit test to compensate for that. >--- > t/db_dependent/Koha/EDI.t | 29 ++++++++++++++++++++--------- > 1 file changed, 20 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Koha/EDI.t b/t/db_dependent/Koha/EDI.t >index 1cc87267893..762ea2e88dc 100755 >--- a/t/db_dependent/Koha/EDI.t >+++ b/t/db_dependent/Koha/EDI.t >@@ -294,7 +294,7 @@ subtest '_handle_008_field' => sub { > }; > > subtest 'process_invoice' => sub { >- plan tests => 11; >+ plan tests => 12; > > $schema->storage->txn_begin; > >@@ -363,14 +363,22 @@ subtest 'process_invoice' => sub { > $invoice_message->update( { raw_msg => $raw_msg } ); > > # Process the test invoice file >- warnings_exist { process_invoice($invoice_message) } >- [ >- { carped => qr/Cannot find vendor with ean.*/i }, >- ], >- 'Invoice processed, with warnings, without dieing'; >- >- $logger->trace_like( qr/Adding invoice:.*/, "Trace recorded adding invoice" ) >- ->trace_like( qr/Added as invoiceno.*/, "Trace recorded invoice added" )->error_is( >+ my $error; >+ eval { >+ process_invoice($invoice_message); >+ 1; >+ } or do { >+ $error = $@; >+ }; >+ ok( !$error, 'process_invoice completed without dying' ); >+ >+ $logger->trace_like( >+ qr/Adding invoice:.*/, >+ "Trace recorded adding invoice" >+ )->trace_like( >+ qr/Added as invoiceno.*/, >+ "Trace recorded invoice added" >+ )->error_is( > 'Skipping invoice line, no associated ordernumber', > "Received expected log line for missing ordernumber line" > )->error_like( >@@ -385,6 +393,9 @@ subtest 'process_invoice' => sub { > )->trace_like( > qr/Updating bib:.*/, > 'Trace recorded bib updated' >+ )->error_like( >+ qr/Cannot find vendor with ean.*/, >+ 'Received expected log line for missing ean' > )->clear(); > > my $invoice3 = Koha::Acquisition::Invoices->search( { invoicenumber => 'INV00003' }, { rows => 1 } )->single; >-- >2.47.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38689
:
175788
|
175789
|
175790
|
175793
|
175794
|
175795
|
175796
|
175797
|
175809
|
175810
|
175811
|
175812
|
175813
|
175814
|
175815
|
175816
|
175817
|
176127
|
176128
|
176129
|
176130
|
176131
|
176132
|
176133
|
176134
|
176173
|
176174
|
176175
|
176176
|
176177
|
176178
|
176179
|
176180
|
176181
|
176182
|
176183
|
176373
|
176374
|
176375
|
176376
|
176377
|
176378
|
176379
|
176380
|
176381
|
176382
|
176524
|
176525
|
176526
|
176527
|
176528
|
176529
|
176530
|
176531
|
176532
|
176533
|
176605
|
176606
|
176607
|
176608
|
176609
|
176610
|
176611
|
176612
|
176613
|
176614