Lines 18-29
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 => 73; |
21 |
use Test::More tests => 77; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use MARC::Record; |
25 |
use MARC::Record; |
26 |
|
26 |
|
|
|
27 |
use utf8; |
28 |
|
27 |
my ( $email_object, $sendmail_params ); |
29 |
my ( $email_object, $sendmail_params ); |
28 |
|
30 |
|
29 |
my $email_sender_module = Test::MockModule->new('Email::Stuffer'); |
31 |
my $email_sender_module = Test::MockModule->new('Email::Stuffer'); |
Lines 31-36
$email_sender_module->mock(
Link Here
|
31 |
'send_or_die', |
33 |
'send_or_die', |
32 |
sub { |
34 |
sub { |
33 |
( $email_object, $sendmail_params ) = @_; |
35 |
( $email_object, $sendmail_params ) = @_; |
|
|
36 |
my $str = $email_object->email->as_string; |
37 |
unlike $str, qr/I =C3=A2=C2=99=C2=A5 Koha=/, "Content is not double encoded"; |
34 |
warn "Fake send_or_die"; |
38 |
warn "Fake send_or_die"; |
35 |
} |
39 |
} |
36 |
); |
40 |
); |
Lines 110-117
is( $message_id, undef, 'EnqueueLetter without the letter argument returns undef
Link Here
|
110 |
|
114 |
|
111 |
delete $my_message->{message_transport_type}; |
115 |
delete $my_message->{message_transport_type}; |
112 |
$my_message->{letter} = { |
116 |
$my_message->{letter} = { |
113 |
content => 'a message', |
117 |
content => 'I ♥ Koha', |
114 |
title => 'message title', |
118 |
title => '啤酒 is great', |
115 |
metadata => 'metadata', |
119 |
metadata => 'metadata', |
116 |
code => 'TEST_MESSAGE', |
120 |
code => 'TEST_MESSAGE', |
117 |
content_type => 'text/plain', |
121 |
content_type => 'text/plain', |
Lines 534-540
is($email_object->email->header('To'), 'robert.tables@mail.com', "mailto address
Link Here
|
534 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', '' ); |
538 |
t::lib::Mocks::mock_preference( 'SendAllEmailsTo', '' ); |
535 |
|
539 |
|
536 |
subtest 'SendAlerts - claimissue' => sub { |
540 |
subtest 'SendAlerts - claimissue' => sub { |
537 |
plan tests => 9; |
541 |
plan tests => 11; |
538 |
|
542 |
|
539 |
use C4::Serials; |
543 |
use C4::Serials; |
540 |
|
544 |
|
Lines 749-755
subtest 'TranslateNotices' => sub {
Link Here
|
749 |
|
753 |
|
750 |
subtest 'SendQueuedMessages' => sub { |
754 |
subtest 'SendQueuedMessages' => sub { |
751 |
|
755 |
|
752 |
plan tests => 9; |
756 |
plan tests => 12; |
753 |
|
757 |
|
754 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
758 |
t::lib::Mocks::mock_preference( 'SMSSendDriver', 'Email' ); |
755 |
t::lib::Mocks::mock_preference('EmailSMSSendDriverFromAddress', ''); |
759 |
t::lib::Mocks::mock_preference('EmailSMSSendDriverFromAddress', ''); |
756 |
- |
|
|