View | Details | Raw Unified | Return to bug 15969
Collapse All | Expand All

(-)a/t/db_dependent/Letters.t (-4 / +4 lines)
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 => 77;
21
use Test::More tests => 78;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
24
Lines 103-109 is( $message_id, undef, 'EnqueueLetter without the letter argument returns undef Link Here
103
103
104
delete $my_message->{message_transport_type};
104
delete $my_message->{message_transport_type};
105
$my_message->{letter} = {
105
$my_message->{letter} = {
106
    content      => 'a message',
106
    content      => 'a message:__MESSAGE_ID__',
107
    title        => 'message title',
107
    title        => 'message title',
108
    metadata     => 'metadata',
108
    metadata     => 'metadata',
109
    code         => 'TEST_MESSAGE',
109
    code         => 'TEST_MESSAGE',
Lines 127-133 is( @$messages, 1, 'one message stored for the borrower' ); Link Here
127
is( $messages->[0]->{message_id}, $message_id, 'EnqueueLetter returns the message id correctly' );
127
is( $messages->[0]->{message_id}, $message_id, 'EnqueueLetter returns the message id correctly' );
128
is( $messages->[0]->{borrowernumber}, $borrowernumber, 'EnqueueLetter stores the borrower number correctly' );
128
is( $messages->[0]->{borrowernumber}, $borrowernumber, 'EnqueueLetter stores the borrower number correctly' );
129
is( $messages->[0]->{subject}, $my_message->{letter}->{title}, 'EnqueueLetter stores the subject correctly' );
129
is( $messages->[0]->{subject}, $my_message->{letter}->{title}, 'EnqueueLetter stores the subject correctly' );
130
is( $messages->[0]->{content}, $my_message->{letter}->{content}, 'EnqueueLetter stores the content correctly' );
130
is( @{[ split( /:/, $messages->[0]->{content} ) ]}[0], @{[ split( /:/, $my_message->{letter}->{content} ) ]}[0], 'EnqueueLetter stores the content correctly' );
131
ok( @{[ split( /:/, $messages->[0]->{content} ) ]}[1] =~ /^\d+$/, 'Content __MESSAGE_ID__ is replaced with an actual integer id' );
131
is( $messages->[0]->{message_transport_type}, $my_message->{message_transport_type}, 'EnqueueLetter stores the message type correctly' );
132
is( $messages->[0]->{message_transport_type}, $my_message->{message_transport_type}, 'EnqueueLetter stores the message type correctly' );
132
is( $messages->[0]->{status}, 'pending', 'EnqueueLetter stores the status pending correctly' );
133
is( $messages->[0]->{status}, 'pending', 'EnqueueLetter stores the status pending correctly' );
133
134
134
- 

Return to bug 15969