Bugzilla – Attachment 130995 Details for
Bug 30130
Allow setting EDI type at the vendor level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30130: Unit tests
Bug-30130-Unit-tests.patch (text/plain), 2.08 KB, created by
Katrin Fischer
on 2022-02-21 22:08:53 UTC
(
hide
)
Description:
Bug 30130: Unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-02-21 22:08:53 UTC
Size:
2.08 KB
patch
obsolete
>From d0099a888307931f278964bf61d13d356829f4c1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 21 Feb 2022 16:21:48 +0000 >Subject: [PATCH] Bug 30130: Unit tests > >This patch adds a unit test for the internal 'beginning_of_message' >method in Koha::Edifact::Order to check that the vendor standard >parameter is being interpreted coorectly. > >Test plan >1. Run the tests, they should pass > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Edifact/Order.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Edifact/Order.t b/t/db_dependent/Koha/Edifact/Order.t >index 32a07db8ba..f624907a52 100755 >--- a/t/db_dependent/Koha/Edifact/Order.t >+++ b/t/db_dependent/Koha/Edifact/Order.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use Koha::Edifact::Order; > >@@ -29,6 +29,32 @@ my $schema = Koha::Database->new->schema; > > my $builder = t::lib::TestBuilder->new; > >+subtest 'beggining_of_message tests' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $basketno = sprintf '%011d', '123456'; >+ my $edi_vendor = $builder->build( >+ { >+ source => 'VendorEdiAccount', >+ value => { >+ standard => 'EUR', >+ } >+ } >+ ); >+ my $dbic_edi_vendor = $schema->resultset('VendorEdiAccount')->find($edi_vendor->{id}); >+ >+ my $bgm = Koha::Edifact::Order::beginning_of_message($basketno, $dbic_edi_vendor, 1); >+ is( $bgm, qq{BGM+220+$basketno+9'}, "When vendor is set to EDItEUR standard we use 220 in BGM segment"); >+ >+ $dbic_edi_vendor->update({ standard => 'BIC'}); >+ $bgm = Koha::Edifact::Order::beginning_of_message($basketno, $dbic_edi_vendor, 1); >+ is( $bgm, qq{BGM+220+$basketno+9'}, "When vendor is set to BiC standard we use 22V in BGM segment"); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'order_line() tests' => sub { > # TODO: Split up order_line() to smaller methods in order > # to allow better testing >-- >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 30130
:
130852
|
130860
|
130960
|
130966
|
130967
|
130968
|
130969
|
130970
|
130991
|
130992
|
130993
|
130994
|
130995
|
130996
|
132404
|
132405
|
132406
|
132407
|
132408
|
132409
|
132410