Bugzilla – Attachment 69119 Details for
Bug 18712
make test is failing with an empty DB - t/Matcher.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18712: Fix t/Matcher.t if DB is empty
Bug-18712-Fix-tMatchert-if-DB-is-empty.patch (text/plain), 1.35 KB, created by
Nick Clemens
on 2017-11-13 13:37:51 UTC
(
hide
)
Description:
Bug 18712: Fix t/Matcher.t if DB is empty
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2017-11-13 13:37:51 UTC
Size:
1.35 KB
patch
obsolete
>From ff1b1a6ab233cff3f8a6a7909b9c25351f429e75 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Nov 2017 10:13:46 -0300 >Subject: [PATCH] Bug 18712: Fix t/Matcher.t if DB is empty > >t/Matcher.t is failing with an empty DB, the data are not mocked >correctly > >Test plan: >drop your DB and recreate it without any data and prove t/Matcher.t > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/Matcher.t | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/t/Matcher.t b/t/Matcher.t >index 55b5a87..3a5494e 100755 >--- a/t/Matcher.t >+++ b/t/Matcher.t >@@ -33,10 +33,13 @@ BEGIN { > } > } > >-use_ok('C4::Matcher'); >- > use Test::DBIx::Class; > >+my $db = Test::MockModule->new('Koha::Database'); >+$db->mock( _new_schema => sub { return Schema(); } ); >+ >+use_ok('C4::Matcher'); >+ > fixtures_ok [ > MarcMatcher => [ > [ 'matcher_id', 'code', 'description', 'record_type', 'threshold' ], >@@ -45,9 +48,6 @@ fixtures_ok [ > ], > ], 'add fixtures'; > >-my $db = Test::MockModule->new('Koha::Database'); >-$db->mock( _new_schema => sub { return Schema(); } ); >- > my @matchers = C4::Matcher::GetMatcherList(); > > is( $matchers[0]->{'matcher_id'}, 1, 'First matcher_id value is 1' ); >-- >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 18712
:
63893
|
68890
|
68891
|
68985
|
68986
|
68987
| 69119 |
69120
|
69121