Bug 18457: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 41669b45a8)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Jonathan Druart 2017-04-24 14:16:34 -03:00 committed by Katrin Fischer
parent d9fa24e8bb
commit 1cc02f8bd2
1 changed files with 14 additions and 1 deletions

View File

@ -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;
@ -491,3 +491,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' );
};