Bugzilla – Attachment 153906 Details for
Bug 34415
Remove Test::DBIx::Class from t/EdiTransport.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34415: Remove T::D::C from EdiTransport.t
Bug-34415-Remove-TDC-from-EdiTransportt.patch (text/plain), 2.76 KB, created by
Marcel de Rooy
on 2023-07-26 11:34:00 UTC
(
hide
)
Description:
Bug 34415: Remove T::D::C from EdiTransport.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-07-26 11:34:00 UTC
Size:
2.76 KB
patch
obsolete
>From d55568003ca629946ea8d12d888ddd9200451dc4 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 26 Jul 2023 07:29:06 +0000 >Subject: [PATCH] Bug 34415: Remove T::D::C from EdiTransport.t >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/EdiTransport.t | 57 +++++++++++++++++++++--------------------------- > 1 file changed, 25 insertions(+), 32 deletions(-) > >diff --git a/t/EdiTransport.t b/t/EdiTransport.t >index fb2442ea7e..f800611baf 100755 >--- a/t/EdiTransport.t >+++ b/t/EdiTransport.t >@@ -2,40 +2,30 @@ > > use Modern::Perl; > use FindBin qw( $Bin ); >-use Test::More; >-use Test::MockModule; >-use Module::Load::Conditional qw/check_install/; >- >-BEGIN { >- if ( check_install( module => 'Test::DBIx::Class' ) ) { >- plan tests => 5; >- } >- else { >- plan skip_all => 'Need Test::DBIx::Class'; >- } >- >-} >- >-use Test::DBIx::Class; >- >-fixtures_ok [ >- VendorEdiAccount => >- [ [ 'id', 'description', 'transport' ], [ 1, 'test vendor', 'FILE' ], ], >- EdifactMessage => [ >- [ 'message_type', 'filename', 'raw_msg' ], >- [ 'TEST', 'duplicate', 'message_contents' ], >- ], >- ], >- 'add_fixtures'; >+use Test::More tests => 5; >+use Test::Warn; > >-my $filename = 'QUOTES_413514.CEQ'; >+use t::lib::TestBuilder; >+ >+use Koha::Database; >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+$schema->storage->txn_begin; > >-my $db = Test::MockModule->new('Koha::Database'); >-$db->mock( _new_schema => sub { return Schema(); } ); >+my $account = $builder->build({ source => 'VendorEdiAccount', value => { >+ description => 'test vendor', transport => 'FILE', >+}}); >+$builder->build({ source => 'EdifactMessage', value => { >+ message_type => 'TEST', filename => 'duplicate', raw_msg => 'message_contents' >+}}); >+ >+my $filename = 'QUOTES_413514.CEQ'; > > use_ok('Koha::Edifact::Transport'); > >-my $trans = Koha::Edifact::Transport->new(1); >+my $trans = Koha::Edifact::Transport->new( $account->{id} ); > > isa_ok( $trans, 'Koha::Edifact::Transport' ); > >@@ -46,12 +36,15 @@ $mhash->{message_type} = 'TEST'; # set a bogus message type > > $trans->ingest( $mhash, $filename ); > >-my $cnt = ResultSet('EdifactMessage')->count(); >+my $cnt = $schema->resultset('EdifactMessage')->count(); > > is( $cnt, 2, 'unique message name ingested' ); > >-$trans->ingest( $mhash, $filename ); # try a repeat ingest >+# try a repeat ingest >+warning_like {$trans->ingest( $mhash, $filename ) } qr/skipping ingest of QUOTES_413514.CEQ/, 'Warning on repeated ingest'; > >-my $cnt2 = ResultSet('EdifactMessage')->count(); >+my $cnt2 = $schema->resultset('EdifactMessage')->count(); > > is( $cnt2, 2, 'duplicate message name not ingested' ); >+ >+$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 34415
:
153906
|
153907
|
153908
|
153909
|
153943
|
153944
|
153945
|
153946
|
155174
|
155798