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

(-)a/Koha/Notice/Message.pm (+16 lines)
Lines 32-37 Koha::Notice::Message - Koha notice message Object class, related to the message Link Here
32
32
33
=cut
33
=cut
34
34
35
=head3 patron
36
37
    my $patron = $message->patron;
38
39
Returns the Koha::Patron object for the recipient of the queued message
40
41
=cut
42
43
sub patron {
44
    my ( $self ) = @_;
45
46
    $self->{_patron} ||= Koha::Patrons->find( $self->borrowernumber );
47
48
    return $self->{_patron};
49
}
50
35
=head3 type
51
=head3 type
36
52
37
=cut
53
=cut
(-)a/t/db_dependent/Letters.t (-3 / +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 => 99;
21
use Test::More tests => 100;
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 155-161 is( $messages->[0]->{failure_code}, '', 'Failure code for successful message cor Link Here
155
155
156
# Setting time_queued to something else than now
156
# Setting time_queued to something else than now
157
my $yesterday = dt_from_string->subtract( days => 1 );
157
my $yesterday = dt_from_string->subtract( days => 1 );
158
Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store;
158
my $message_obj = Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store;
159
my $patron_obj = Koha::Patrons->find( $borrowernumber );
160
is_deeply( $message_obj->patron, $patron_obj, "Koha::Notice::Message->patron sub correctly returns patron object");
159
161
160
# SendQueuedMessages
162
# SendQueuedMessages
161
163
162
- 

Return to bug 33260