Bugzilla – Attachment 47806 Details for
Bug 15719
Silence warning in C4/Language.pm during web install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15719: Silence warning in C4/Language.pm during web install - tests
Bug-15719-Silence-warning-in-C4Languagepm-during-w.patch (text/plain), 1.87 KB, created by
Jonathan Druart
on 2016-02-09 12:36:46 UTC
(
hide
)
Description:
Bug 15719: Silence warning in C4/Language.pm during web install - tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-09 12:36:46 UTC
Size:
1.87 KB
patch
obsolete
>From 1f6dd292cdab8c69e02728684ed2990626baa955 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 1 Feb 2016 18:26:41 -0500 >Subject: [PATCH] Bug 15719: Silence warning in C4/Language.pm during web > install - tests > >Test empty database case. > >TEST PLAN >--------- >1) prove -v t/Languages.t > -- success (because test case is missing) >2) Apply this patch >3) prove -v t/Languages.t > -- success, but warning printed. >4) run koha qa test tools > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised. QA test tools rus OK > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/Languages.t | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/t/Languages.t b/t/Languages.t >index 6b0f638..8fee200 100644 >--- a/t/Languages.t >+++ b/t/Languages.t >@@ -18,7 +18,7 @@ > # with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > use CGI qw ( -utf8 ); > >@@ -28,13 +28,16 @@ BEGIN { > > my @languages = (); # stores the list of active languages > # for the syspref mock >+my $return_undef = 0; > > my $module_context = new Test::MockModule('C4::Context'); > > $module_context->mock( > preference => sub { > my ($self, $pref) = @_; >- if ($pref =~ /language/) { >+ if ($return_undef) { >+ return undef; >+ } elsif ($pref =~ /language/) { > return join ',', @languages; > } else { > return 'XXX'; >@@ -50,3 +53,6 @@ is(C4::Languages::getlanguage($query), 'de-DE', 'default to first language speci > > @languages = (); > is(C4::Languages::getlanguage($query), 'en', 'default to English if no language specified in syspref (bug 10560)'); >+ >+$return_undef = 1; >+is(C4::Languages::getlanguage($query), 'en', 'default to English if no database'); >-- >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 15719
:
47533
|
47534
|
47744
|
47745
| 47806 |
47807