|
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 => 89; |
21 |
use Test::More tests => 92; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
use Test::Exception; |
24 |
use Test::Exception; |
|
Lines 153-158
my $yesterday = dt_from_string->subtract( days => 1 );
Link Here
|
| 153 |
Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store; |
153 |
Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store; |
| 154 |
|
154 |
|
| 155 |
# SendQueuedMessages |
155 |
# SendQueuedMessages |
|
|
156 |
|
| 157 |
throws_ok { |
| 158 |
C4::Letters::SendQueuedMessages( { message_id => undef } ); |
| 159 |
} |
| 160 |
'Koha::Exceptions::BadParameter', 'Undef message_id throws an exception'; |
| 161 |
|
| 162 |
throws_ok { |
| 163 |
C4::Letters::SendQueuedMessages( { message_id => 0 } ); |
| 164 |
} |
| 165 |
'Koha::Exceptions::BadParameter', 'message_id of 0 throws an exception'; |
| 166 |
|
| 167 |
throws_ok { |
| 168 |
C4::Letters::SendQueuedMessages( { message_id => q{} } ); |
| 169 |
} |
| 170 |
'Koha::Exceptions::BadParameter', 'Empty string message_id throws an exception'; |
| 171 |
|
| 156 |
my $messages_processed = C4::Letters::SendQueuedMessages( { type => 'email' }); |
172 |
my $messages_processed = C4::Letters::SendQueuedMessages( { type => 'email' }); |
| 157 |
is($messages_processed, 0, 'No queued messages processed if type limit passed with unused type'); |
173 |
is($messages_processed, 0, 'No queued messages processed if type limit passed with unused type'); |
| 158 |
$messages_processed = C4::Letters::SendQueuedMessages( { type => 'sms' }); |
174 |
$messages_processed = C4::Letters::SendQueuedMessages( { type => 'sms' }); |
| 159 |
- |
|
|