View | Details | Raw Unified | Return to bug 18457
Collapse All | Expand All

(-)a/t/db_dependent/Letters.t (-2 / +14 lines)
Lines 18-24 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Test::More tests => 80;
21
use Test::More tests => 81;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
24
Lines 533-535 is($err2, 1, "Successfully sent serial notification"); Link Here
533
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification");
533
is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification");
534
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully');
534
is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully');
535
}
535
}
536
- 
536
537
subtest 'SendQueuedMessages' => sub {
538
    plan tests => 1;
539
    t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' );
540
    my $patron = Koha::Patrons->find($borrowernumber);
541
    $dbh->do(q|
542
        INSERT INTO message_queue(borrowernumber, subject, content, message_transport_type, status, letter_code)
543
        VALUES (?, 'subject', 'content', 'sms', 'pending', 'just_a_code')
544
        |, undef, $borrowernumber
545
    );
546
    eval { C4::Letters::SendQueuedMessages(); };
547
    is( $@, '', 'SendQueuedMessages should not explode if the patron does not have a sms provider set' );
548
};

Return to bug 18457