Bugzilla – Attachment 65578 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: Fix few other tests
Bug-18851-Fix-few-other-tests.patch (text/plain), 2.90 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-08-07 15:36:45 UTC
(
hide
)
Description:
Bug 18851: Fix few other tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-08-07 15:36:45 UTC
Size:
2.90 KB
patch
obsolete
>From 4a161aab4e48094bb11e687d5bb02705db41ecd6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Jul 2017 16:11:44 -0300 >Subject: [PATCH] Bug 18851: Fix few other tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/Patron.t | 14 ++++++++++++-- > t/Search.t | 12 +++++++++++- > t/SuggestionEngine_AuthorityFile.t | 14 +++++++++++++- > t/XSLT.t | 2 ++ > 4 files changed, 38 insertions(+), 4 deletions(-) > >diff --git a/t/Patron.t b/t/Patron.t >index be66f9d..3b87939 100755 >--- a/t/Patron.t >+++ b/t/Patron.t >@@ -17,16 +17,26 @@ > > use Modern::Perl; > >-use Test::More tests => 11; >+use Test::More; > use Test::Warn; > use t::lib::Mocks; > >+use Module::Load::Conditional qw/check_install/; >+ > BEGIN { >- use Test::DBIx::Class; >+ if ( check_install( module => 'Test::DBIx::Class' ) ) { >+ plan tests => 11; >+ } else { >+ plan skip_all => "Need Test::DBIx::Class" >+ } > use_ok('Koha::Object'); > use_ok('Koha::Patron'); > } > >+use Test::DBIx::Class; >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); >+ > my $object = Koha::Patron->new( { surname => 'Test Patron' } ); > is( $object->surname(), 'Test Patron', "Accessor returns correct value" ); > $object->surname('Test Patron Surname'); >diff --git a/t/Search.t b/t/Search.t >index 5c35419..104e094a 100755 >--- a/t/Search.t >+++ b/t/Search.t >@@ -17,9 +17,19 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More; > use t::lib::Mocks; > >+use Module::Load::Conditional qw/check_install/; >+ >+BEGIN { >+ if ( check_install( module => 'Test::DBIx::Class' ) ) { >+ plan tests => 3; >+ } else { >+ plan skip_all => "Need Test::DBIx::Class" >+ } >+} >+ > # Mock the DB connexion and C4::Context > use Test::DBIx::Class; > >diff --git a/t/SuggestionEngine_AuthorityFile.t b/t/SuggestionEngine_AuthorityFile.t >index 96ca44d..b648f31 100755 >--- a/t/SuggestionEngine_AuthorityFile.t >+++ b/t/SuggestionEngine_AuthorityFile.t >@@ -28,8 +28,20 @@ use Test::More; > use Test::MockModule; > use t::lib::Mocks; > >-# Mock the DB connexion and C4::Context >+use Module::Load::Conditional qw/check_install/; >+ >+BEGIN { >+ if ( check_install( module => 'Test::DBIx::Class' ) ) { >+ plan tests => 3; >+ } else { >+ plan skip_all => "Need Test::DBIx::Class" >+ } >+} >+ >+# Mock the DB connexion > use Test::DBIx::Class; >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); > > use_ok('Koha::SuggestionEngine'); > >diff --git a/t/XSLT.t b/t/XSLT.t >index aefa4df..b902aa6 100755 >--- a/t/XSLT.t >+++ b/t/XSLT.t >@@ -36,6 +36,8 @@ BEGIN { > }; > > use Test::DBIx::Class; >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); > > my $dir = File::Temp->newdir(); > my @themes = ('prog', 'test'); >-- >2.7.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