Bugzilla – Attachment 122515 Details for
Bug 28640
Add EDI order status to basket details display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28640: Unit tests for edi_order relation
Bug-28640-Unit-tests-for-ediorder-relation.patch (text/plain), 2.21 KB, created by
Kyle M Hall (khall)
on 2021-07-01 13:13:24 UTC
(
hide
)
Description:
Bug 28640: Unit tests for edi_order relation
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-07-01 13:13:24 UTC
Size:
2.21 KB
patch
obsolete
>From f9736d9bd0200cb3fa2538c96328a6580b0d7136 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 30 Jun 2021 14:26:02 +0100 >Subject: [PATCH] Bug 28640: Unit tests for edi_order relation > >Test plan >1/ Run t/db_dependent/Koha/Acquisition/Basket.t > >Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Acquisition/Basket.t | 42 +++++++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t >index 7b6c17d552..28dce59852 100755 >--- a/t/db_dependent/Koha/Acquisition/Basket.t >+++ b/t/db_dependent/Koha/Acquisition/Basket.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > use Test::Exception; > > use t::lib::TestBuilder; >@@ -303,6 +303,46 @@ subtest 'orders' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'edi_order' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $basket = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets' >+ } >+ ); >+ >+ is( $basket->edi_order, undef, >+ 'edi_order returns undefined if there are no edi_messages of type "ORDER" attached' ); >+ >+ my $order_message_1 = $builder->build( >+ { >+ source => 'EdifactMessage', >+ value => { basketno => $basket->basketno, message_type => 'ORDERS', transfer_date => '2019-07-30' } >+ } >+ ); >+ >+ my $edi_message = $basket->edi_order; >+ is( ref($edi_message), 'Koha::Schema::Result::EdifactMessage', >+ 'edi_order returns an EdifactMessage if one is attached' ); >+ >+ my $order_message_2 = $builder->build( >+ { >+ source => 'EdifactMessage', >+ value => { basketno => $basket->basketno, message_type => 'ORDERS' } >+ } >+ ); >+ >+ $edi_message = $basket->edi_order; >+ is( $edi_message->id, $order_message_2->{id}, >+ 'edi_order returns the most recently associated ORDERS EdifactMessage' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'is_closed() tests' => sub { > > plan tests => 2; >-- >2.30.1 (Apple Git-130)
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 28640
:
122506
|
122507
|
122508
|
122511
|
122512
|
122513
|
122514
| 122515 |
122516
|
122517