Bugzilla – Attachment 62620 Details for
Bug 18457
process_message_queue.pl will die if a patron has no sms_provider_id set but sms via email is enabled for that patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18457: Add tests
Bug-18457-Add-tests.patch (text/plain), 1.60 KB, created by
Jonathan Druart
on 2017-04-24 17:17:10 UTC
(
hide
)
Description:
Bug 18457: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-24 17:17:10 UTC
Size:
1.60 KB
patch
obsolete
>From c350176ac67569347c37b4f43a8d9b21bc425d43 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 24 Apr 2017 14:16:34 -0300 >Subject: [PATCH] Bug 18457: Add tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Letters.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index e752a45..33f7af4 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,7 +18,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 80; >+use Test::More tests => 81; > use Test::MockModule; > use Test::Warn; > >@@ -533,3 +533,16 @@ is($err2, 1, "Successfully sent serial notification"); > is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification"); > is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); > } >+ >+subtest 'SendQueuedMessages' => sub { >+ plan tests => 1; >+ t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); >+ my $patron = Koha::Patrons->find($borrowernumber); >+ $dbh->do(q| >+ INSERT INTO message_queue(borrowernumber, subject, content, message_transport_type, status, letter_code) >+ VALUES (?, 'subject', 'content', 'sms', 'pending', 'just_a_code') >+ |, undef, $borrowernumber >+ ); >+ eval { C4::Letters::SendQueuedMessages(); }; >+ is( $@, '', 'SendQueuedMessages should not explode if the patron does not have a sms provider set' ); >+}; >-- >2.9.3
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 18457
:
62369
|
62554
|
62580
|
62619
| 62620