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

(-)a/Koha/Notice/Message.pm (+16 lines)
Lines 88-93 EOS Link Here
88
    return $wrapped;
88
    return $wrapped;
89
}
89
}
90
90
91
=head3 patron
92
93
    my $patron = $message->patron;
94
95
Returns the Koha::Patron object for the recipient of the queued message
96
97
=cut
98
99
sub patron {
100
    my ($self) = @_;
101
102
    $self->{_patron} ||= Koha::Patrons->find( $self->borrowernumber );
103
104
    return $self->{_patron};
105
}
106
91
=head3 type
107
=head3 type
92
108
93
=cut
109
=cut
(-)a/t/db_dependent/Letters.t (-4 / +5 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use File::Basename qw(dirname);
21
use File::Basename qw(dirname);
22
use Test::More tests => 102;
22
use Test::More tests => 103;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::Warn;
24
use Test::Warn;
25
use Test::Exception;
25
use Test::Exception;
Lines 155-162 is( $messages->[0]->{updated_on}, $messages->[0]->{time_queued}, 'Time status ch Link Here
155
is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty');
155
is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty');
156
156
157
# Setting time_queued to something else than now
157
# Setting time_queued to something else than now
158
my $yesterday = dt_from_string->subtract( days => 1 );
158
my $yesterday   = dt_from_string->subtract( days => 1 );
159
Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store;
159
my $message_obj = Koha::Notice::Messages->find( $messages->[0]->{message_id} )->time_queued($yesterday)->store;
160
my $patron_obj  = Koha::Patrons->find($borrowernumber);
161
is_deeply( $message_obj->patron, $patron_obj, "Koha::Notice::Message->patron sub correctly returns patron object" );
160
162
161
163
162
# EnqueueLetter - Test characters limitation for SMS
164
# EnqueueLetter - Test characters limitation for SMS
163
- 

Return to bug 33260