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

(-)a/Koha/Notice/Message.pm (+16 lines)
Lines 156-161 sub stylesheets { Link Here
156
    return $all_stylesheets;
156
    return $all_stylesheets;
157
}
157
}
158
158
159
=head3 patron
160
161
    my $patron = $message->patron;
162
163
Returns the Koha::Patron object for the recipient of the queued message
164
165
=cut
166
167
sub patron {
168
    my ($self) = @_;
169
170
    $self->{_patron} ||= Koha::Patrons->find( $self->borrowernumber );
171
172
    return $self->{_patron};
173
}
174
159
=head3 type
175
=head3 type
160
176
161
=cut
177
=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 => 103;
22
use Test::More tests => 104;
23
23
24
use Test::MockModule;
24
use Test::MockModule;
25
use Test::Warn;
25
use Test::Warn;
Lines 157-164 is( $messages->[0]->{updated_on}, $messages->[0]->{time_queued}, 'Time status ch Link Here
157
is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty');
157
is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty');
158
158
159
# Setting time_queued to something else than now
159
# Setting time_queued to something else than now
160
my $yesterday = dt_from_string->subtract( days => 1 );
160
my $yesterday   = dt_from_string->subtract( days => 1 );
161
Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store;
161
my $message_obj = Koha::Notice::Messages->find( $messages->[0]->{message_id} )->time_queued($yesterday)->store;
162
my $patron_obj  = Koha::Patrons->find($borrowernumber);
163
is_deeply( $message_obj->patron, $patron_obj, "Koha::Notice::Message->patron sub correctly returns patron object" );
162
164
163
165
164
# EnqueueLetter - Test characters limitation for SMS
166
# EnqueueLetter - Test characters limitation for SMS
165
- 

Return to bug 33260