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