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