|
Lines 629-635
subtest 'TranslateNotices' => sub {
Link Here
|
| 629 |
|
629 |
|
| 630 |
subtest 'SendQueuedMessages' => sub { |
630 |
subtest 'SendQueuedMessages' => sub { |
| 631 |
|
631 |
|
| 632 |
plan tests => 2; |
632 |
plan tests => 3; |
| 633 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
633 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
| 634 |
my $patron = Koha::Patrons->find($borrowernumber); |
634 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 635 |
$dbh->do(q| |
635 |
$dbh->do(q| |
|
Lines 648-653
subtest 'SendQueuedMessages' => sub {
Link Here
|
| 648 |
borrowernumber => $borrowernumber, |
648 |
borrowernumber => $borrowernumber, |
| 649 |
status => 'sent' |
649 |
status => 'sent' |
| 650 |
})->next()->to_address(); |
650 |
})->next()->to_address(); |
| 651 |
is( $sms_message_address, '5555555555@kidclamp.rocks', 'SendQueuedMessages populates the to address correctly for SMS by email' ); |
651 |
is( $sms_message_address, '5555555555@kidclamp.rocks', 'SendQueuedMessages populates the to address correctly for SMS by email when to_address not set' ); |
|
|
652 |
$schema->resultset('MessageQueue')->search({borrowernumber => $borrowernumber,status => 'sent'})->delete(); #clear borrower queue |
| 653 |
$my_message->{to_address} = 'fixme@kidclamp.iswrong'; |
| 654 |
$message_id = C4::Letters::EnqueueLetter($my_message); |
| 655 |
C4::Letters::SendQueuedMessages(); |
| 656 |
$sms_message_address = $schema->resultset('MessageQueue')->search({ |
| 657 |
borrowernumber => $borrowernumber, |
| 658 |
status => 'sent' |
| 659 |
})->next()->to_address(); |
| 660 |
is( $sms_message_address, '5555555555@kidclamp.rocks', 'SendQueuedMessages populates the to address correctly for SMS by email when to_address is set incorrectly' ); |
| 652 |
|
661 |
|
| 653 |
}; |
662 |
}; |
| 654 |
- |
|
|