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