Bugzilla – Attachment 21133 Details for
Bug 10897
t/ILSDI_Services.t is db dependent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10897 Removing DB dependence of t/ILSDI_Services.t
Bug-10897-Removing-DB-dependence-of-tILSDIServices.patch (text/plain), 1.62 KB, created by
Robin Sheat
on 2013-09-17 02:54:31 UTC
(
hide
)
Description:
Bug 10897 Removing DB dependence of t/ILSDI_Services.t
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2013-09-17 02:54:31 UTC
Size:
1.62 KB
patch
obsolete
>From e0426d0b8aec0eef9f3d32d66ff5d1c944c11001 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Tue, 17 Sep 2013 11:43:53 +1200 >Subject: [PATCH] Bug 10897 Removing DB dependence of t/ILSDI_Services.t > >To test >1/ Run the test with a config that doesnt allow db access you should >get a message like > >t/ILSDI_Services.t .................. DBI >connect('dbname=koha;host=localhost;port=3306','kohaadmin',...) >failed: Access denied for user 'kohaadmin'@'localhost' (using >password: YES) at >/home/travis/build/ranginui/koha/blib/PERL_MODULE_DIR/C4/Context.pm >line 810. > >2/ Apply patch and run again > >3/ Test should now run cleanly > >(cherry picked from commit c525dd384eba818076929cd20f10003c3b804111) > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Robin Sheat <robin@catalyst.net.nz> >--- > t/ILSDI_Services.t | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/t/ILSDI_Services.t b/t/ILSDI_Services.t >index 99476d3..1d330b9 100755 >--- a/t/ILSDI_Services.t >+++ b/t/ILSDI_Services.t >@@ -1,14 +1,25 @@ > #!/usr/bin/perl > # >-# This Koha test module is a stub! >+# This Koha test module is a stub! > # Add more tests here!!! > > use strict; > use warnings; > > use Test::More tests => 1; >+use Test::MockModule; >+use DBD::Mock; >+ >+my $module_context = new Test::MockModule('C4::Context'); >+$module_context->mock( >+ '_new_dbh', >+ sub { >+ my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) >+ || die "Cannot create handle: $DBI::errstr\n"; >+ return $dbh; >+ } >+); >+ >+use_ok('C4::ILSDI::Services'); > >-BEGIN { >- use_ok('C4::ILSDI::Services'); >-} > >-- >1.8.1.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 10897
:
21130
| 21133