From: Jonathan Druart Date: Mon, 24 Apr 2017 17:16:34 +0000 (-0300) Subject: Bug 18457: Add tests X-Git-Tag: v17.05.00~232 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=41669b45a808550088146380d534e4f3629590d9;p=koha-ffzg.git Bug 18457: Add tests Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index e752a451fa..33f7af4d49 100644 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -18,7 +18,7 @@ # along with Koha; if not, see . 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' ); +};