Lines 606-612
subtest 'TranslateNotices' => sub {
Link Here
|
606 |
|
606 |
|
607 |
subtest 'SendQueuedMessages' => sub { |
607 |
subtest 'SendQueuedMessages' => sub { |
608 |
|
608 |
|
609 |
plan tests => 1; |
609 |
plan tests => 2; |
610 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
610 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
611 |
my $patron = Koha::Patrons->find($borrowernumber); |
611 |
my $patron = Koha::Patrons->find($borrowernumber); |
612 |
$dbh->do(q| |
612 |
$dbh->do(q| |
Lines 617-620
subtest 'SendQueuedMessages' => sub {
Link Here
|
617 |
eval { C4::Letters::SendQueuedMessages(); }; |
617 |
eval { C4::Letters::SendQueuedMessages(); }; |
618 |
is( $@, '', 'SendQueuedMessages should not explode if the patron does not have a sms provider set' ); |
618 |
is( $@, '', 'SendQueuedMessages should not explode if the patron does not have a sms provider set' ); |
619 |
|
619 |
|
|
|
620 |
my $sms_pro = $builder->build_object({ class => 'Koha::SMS::Providers', value => { domain => 'kidclamp.rocks' } }); |
621 |
ModMember( borrowernumber => $borrowernumber, smsalertnumber => '5555555555', sms_provider_id => $sms_pro->id() ); |
622 |
$message_id = C4::Letters::EnqueueLetter($my_message); #using datas set around line 95 and forward |
623 |
C4::Letters::SendQueuedMessages(); |
624 |
my $sms_message_address = $schema->resultset('MessageQueue')->search({ |
625 |
borrowernumber => $borrowernumber, |
626 |
status => 'sent' |
627 |
})->next()->to_address(); |
628 |
is( $sms_message_address, '5555555555@kidclamp.rocks', 'SendQueuedMessages populates the to address correctly for SMS by email' ); |
629 |
|
620 |
}; |
630 |
}; |
621 |
- |
|
|