Bugzilla – Attachment 132695 Details for
Bug 30135
We should allow configuration of whether EDI LSQ segments map to 'location' or 'collection'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30135: Unit tests
Bug-30135-Unit-tests.patch (text/plain), 3.42 KB, created by
Nick Clemens (kidclamp)
on 2022-03-31 11:20:45 UTC
(
hide
)
Description:
Bug 30135: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-03-31 11:20:45 UTC
Size:
3.42 KB
patch
obsolete
>From 4f57509c886fb6a89b6b32479dc3501f946f6bce Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 21 Feb 2022 17:02:42 +0000 >Subject: [PATCH] Bug 30135: Unit tests > >Add a unit test for EdifactLSQ preference. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/Edifact/Order.t | 42 ++++++++++++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Edifact/Order.t b/t/db_dependent/Koha/Edifact/Order.t >index 32a07db8ba..895069d59b 100755 >--- a/t/db_dependent/Koha/Edifact/Order.t >+++ b/t/db_dependent/Koha/Edifact/Order.t >@@ -23,6 +23,7 @@ use Test::More tests => 2; > > use Koha::Edifact::Order; > >+use t::lib::Mocks; > use t::lib::TestBuilder; > > my $schema = Koha::Database->new->schema; >@@ -32,7 +33,7 @@ my $builder = t::lib::TestBuilder->new; > subtest 'order_line() tests' => sub { > # TODO: Split up order_line() to smaller methods in order > # to allow better testing >- plan tests => 24; >+ plan tests => 27; > > $schema->storage->txn_begin; > >@@ -45,6 +46,7 @@ subtest 'order_line() tests' => sub { > { > biblionumber => $biblio->biblionumber, > location => 'PROCESSING', >+ ccode => 'COLLECTION', > itemcallnumber => '000.101' > } > ); >@@ -54,6 +56,7 @@ subtest 'order_line() tests' => sub { > { > biblionumber => $biblio->biblionumber, > location => 'PROCESSING', >+ ccode => 'COLLECTION', > itemcallnumber => '000.102' > } > ); >@@ -105,6 +108,9 @@ subtest 'order_line() tests' => sub { > > # FIXME: Add test for an order where the attached biblio has been deleted. > >+ # Set EdifactLSQ field to default >+ t::lib::Mocks::mock_preference( 'EdifactLSQ', 'location' ); >+ > $order->basket->create_items('ordering')->store; > is( $edi_order->order_line( 1, $orders[0] ), > undef, 'order_line run for message formed with effective_create_items = "ordering"' ); >@@ -178,6 +184,40 @@ subtest 'order_line() tests' => sub { > is( $segs->[9], "RFF+LI:$ordernumber'", 'RFF segment added containing koha orderline id' ); > is( $segs->[10], "RFF+$supplier_qualifier:$supplier_ordernumber'", 'RFF segment added containing supplier orderline id' ); > >+ # Reset segments for testing EdifactLSQ preference >+ $edi_order->{segs} = []; >+ >+ # Set EdifactLSQ field to ccode >+ t::lib::Mocks::mock_preference( 'EdifactLSQ', 'ccode' ); >+ >+ $order->basket->create_items('ordering')->store; >+ is( $edi_order->order_line( 1, $orders[0] ), >+ undef, 'order_line run for message formed with EdifactLSQ = "ccode"' ); >+ >+ $segs = $edi_order->{segs}; >+ is( >+ $segs->[5], >+ 'GIR+001' >+ . "+$budgetcode:LFN" >+ . "+$item1_homebranch:LLO" >+ . "+$item1_itype:LST" >+ . "+COLLECTION:LSQ" >+ . "+000.101:LSM" >+ . "'", >+ 'GIR segment added for first item and contains item ccode data' >+ ); >+ is( >+ $segs->[6], >+ 'GIR+002' >+ . "+$budgetcode:LFN" >+ . "+$item2_homebranch:LLO" >+ . "+$item2_itype:LST" >+ . "+COLLECTION:LSQ" >+ . "+000.102:LSM" >+ . "'", >+ 'GIR segment added for second item and contains item ccode data' >+ ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.30.2
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 30135
:
130879
|
130971
|
130972
|
131006
|
131007
|
131139
|
131140
|
131141
|
132694
| 132695 |
132696
|
132697
|
133259
|
133294