Bugzilla – Attachment 64992 Details for
Bug 18851
Use Test::DBIx::Class in tests breaks packaging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18851: Tests must be skipped in cardnumber.t if Test::DBIx::Class is not installed
Bug-18851-Tests-must-be-skipped-in-cardnumbert-if-.patch (text/plain), 1.21 KB, created by
Mirko Tietgen
on 2017-07-11 10:58:12 UTC
(
hide
)
Description:
Bug 18851: Tests must be skipped in cardnumber.t if Test::DBIx::Class is not installed
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2017-07-11 10:58:12 UTC
Size:
1.21 KB
patch
obsolete
>From 9ca520978eed937699f66b356a955d82b8bdfcf9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Jul 2017 17:38:41 -0300 >Subject: [PATCH] Bug 18851: Tests must be skipped in cardnumber.t if > Test::DBIx::Class is not installed > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > t/Members/cardnumber.t | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/Members/cardnumber.t b/t/Members/cardnumber.t >index f2f7882..47902f8 100644 >--- a/t/Members/cardnumber.t >+++ b/t/Members/cardnumber.t >@@ -1,7 +1,9 @@ > #!/usr/bin/env perl > > use Modern::Perl; >-use Test::More tests => 25; >+use Module::Load::Conditional qw/check_install/; >+use Test::More; >+use Test::MockModule; > > use t::lib::Mocks; > >@@ -9,9 +11,18 @@ use Koha::Schema; > use_ok('C4::Members'); > > BEGIN { >- use Test::DBIx::Class; >+ if ( check_install( module => 'Test::DBIx::Class' ) ) { >+ plan tests => 25; >+ } else { >+ plan skip_all => "Need Test::DBIx::Class" >+ } > } > >+use Test::DBIx::Class; >+ >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); >+ > my $dbh = C4::Context->dbh; > my $rs = []; > >-- >2.1.4
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 18851
:
64830
|
64831
|
64832
|
64913
|
64979
|
64990
|
64991
|
64992
|
64993
|
65199
|
65368
|
65574
|
65575
|
65576
|
65577
|
65578
|
65579