Bugzilla – Attachment 64016 Details for
Bug 18732
Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18732: Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config
SIGNED-OFF-Bug-18732-Noisy-tSMSt-triggered-by-koha.patch (text/plain), 1.89 KB, created by
Josef Moravec
on 2017-06-06 04:11:29 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18732: Noisy t/SMS.t triggered by koha_conf.xml without sms_send_config
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-06-06 04:11:29 UTC
Size:
1.89 KB
patch
obsolete
>From a11eab6da9349ec24c96027122670fd3705ac2ce Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 5 Jun 2017 18:18:07 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 18732: Noisy t/SMS.t triggered by > koha_conf.xml without sms_send_config > >Upgraded systems may be lacking sms_send_config which makes t/SMS.t noisy. >This tweaks the tests to compensate and change for missing case. > >Remove sms_send_config from your koha-conf.xml file >prove t/SMS.t >-- it will be noisy, but pass. >apply patch >prove t/SMS.t >-- noise gone, test added >run koha qa test tools. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/SMS.pm | 4 ++++ > t/SMS.t | 11 ++++++++++- > 2 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/C4/SMS.pm b/C4/SMS.pm >index c603117..e623e6c 100644 >--- a/C4/SMS.pm >+++ b/C4/SMS.pm >@@ -89,6 +89,10 @@ sub send_sms { > my $driver = exists $params->{'driver'} ? $params->{'driver'} : $self->driver(); > return unless $driver; > >+ if ( ! defined C4::Context->config('sms_send_config') ) { >+ # Should I warn in some way? >+ return; >+ } > > my ($sent, $sender); > >diff --git a/t/SMS.t b/t/SMS.t >index fca44b4..4b6c535 100755 >--- a/t/SMS.t >+++ b/t/SMS.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use t::lib::Mocks; > >-use Test::More tests => 7; >+use Test::More tests => 8; > > BEGIN { > use_ok('C4::SMS'); >@@ -53,6 +53,15 @@ $send_sms = C4::SMS->send_sms({ > }); > is( $send_sms, undef, 'send_sms with an undef driver returns undef' ); > >+t::lib::Mocks::mock_config('sms_send_config',undef); >+$send_sms = C4::SMS->send_sms({ >+ destination => '+33123456789', >+ message => 'my message', >+ driver => 'Test', >+}); >+is( $send_sms, undef, 'send_sms without sms_send_config defined returns undef' ); >+ >+t::lib::Mocks::mock_config('sms_send_config','\tmp'); > $send_sms = C4::SMS->send_sms({ > destination => '+33123456789', > message => 'my message', >-- >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 18732
:
64015
|
64016
|
64120
|
64121
|
64167
|
64285