Bugzilla – Attachment 33639 Details for
Bug 13276
t/XSLT.t shouldn't depend on the DB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13276: t/XSLT.t shouldn't depend on the DB
Bug-13276-tXSLTt-shouldnt-depend-on-the-DB.patch (text/plain), 2.54 KB, created by
Chris Cormack
on 2014-11-18 07:21:23 UTC
(
hide
)
Description:
Bug 13276: t/XSLT.t shouldn't depend on the DB
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-11-18 07:21:23 UTC
Size:
2.54 KB
patch
obsolete
>From db5ddfa87fef1ac2c76086c73f4542fc5d278e85 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 17 Nov 2014 22:51:16 -0500 >Subject: [PATCH] Bug 13276: t/XSLT.t shouldn't depend on the DB > >To reproduce: >- Stop your MySQL server: > $ sudo service mysql stop >- Run > $ prove t/XSLT.t >=> FAIL: some tests fail because of mysql stopped > >To test (MySQL still stopped) >- Apply the patch >- Run > $ prove t/XSLT.t >=> SUCCESS: tests pass because the ycan be loaded regardless of > the absence of the DB server >- Sign off :-D > >Regards > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > t/XSLT.t | 35 ++++++++++++++++++++++++++++------- > 1 file changed, 28 insertions(+), 7 deletions(-) > >diff --git a/t/XSLT.t b/t/XSLT.t >index 64cd597..347d372 100755 >--- a/t/XSLT.t >+++ b/t/XSLT.t >@@ -1,18 +1,37 @@ > #!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >-# This Koha test module is a stub! >-# Add more tests here!!! >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > > use Test::More tests => 8; > use File::Temp; > use File::Path qw/make_path/; >+use Test::MockModule; >+use DBD::Mock; > >-BEGIN { >- use_ok('C4::XSLT'); >-} >+# Mock the DB connexion and C4::Context >+my $context = new Test::MockModule('C4::Context'); >+$context->mock( '_new_dbh', sub { >+ my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) >+ || die "Cannot create handle: $DBI::errstr\n"; >+ return $dbh; >+}); >+ >+use_ok('C4::XSLT'); > > my $dir = File::Temp->newdir(); > my @themes = ('prog', 'test'); >@@ -47,3 +66,5 @@ is(find_and_slurp($dir, 'prog', 'es-ES'), 'Theme prog, language es-ES', 'Found t > is(find_and_slurp($dir, 'test', 'fr-FR'), 'Theme test, language en', 'Fell back to test/en for test/fr-FR'); > is(find_and_slurp($dir, 'nope', 'es-ES'), 'Theme prog, language es-ES', 'Fell back to prog/es-ES for nope/es-ES'); > is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell back to prog/en for nope/fr-FR'); >+ >+1; >-- >2.1.0
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 13276
:
33633
|
33639
|
33640
|
33646