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

(-)a/Koha/Notice/Message.pm (-2 / +17 lines)
Lines 156-164 sub stylesheets { Link Here
156
156
157
=head3 patron
157
=head3 patron
158
158
159
    my $patron = $checkout->patron
159
    my $patron = $message->patron
160
160
161
Return the patron by whom the checkout was done
161
Return the patron by whom this message is for
162
162
163
=cut
163
=cut
164
164
Lines 169-174 sub patron { Link Here
169
    return Koha::Patron->_new_from_dbic($patron_rs);
169
    return Koha::Patron->_new_from_dbic($patron_rs);
170
}
170
}
171
171
172
=head3 template
173
174
    my $template = $message->template
175
176
Return the template from which this message may have been generated
177
178
=cut
179
180
sub template {
181
    my ($self) = @_;
182
    my $template_rs = $self->_result->letter;
183
    return unless $template_rs;
184
    return Koha::Notice::Template->_new_from_dbic($template_rs);
185
}
186
172
=head3 type
187
=head3 type
173
188
174
=cut
189
=cut
(-)a/t/db_dependent/Koha/Notice/Message.t (-1 / +19 lines)
Lines 386-391 subtest 'patron() tests' => sub { Link Here
386
    $schema->storage->txn_rollback;
386
    $schema->storage->txn_rollback;
387
};
387
};
388
388
389
subtest 'template() tests' => sub {
390
    plan tests => 2;
391
392
    $schema->storage->txn_begin;
393
394
    my $template = $builder->build_object( { class => 'Koha::Notice::Templates' } );
395
    my $message  = $builder->build_object(
396
        {
397
            class => 'Koha::Notice::Messages',
398
            value => { letter_id => $template->id }
399
        }
400
    );
401
402
    is( ref( $message->template ), 'Koha::Notice::Template', 'Object type is correct' );
403
    is( $message->template->id,    $template->id,            'Right template linked' );
404
405
    $schema->storage->txn_rollback;
406
};
407
389
subtest 'search_limited' => sub {
408
subtest 'search_limited' => sub {
390
    plan tests => 2;
409
    plan tests => 2;
391
410
392
- 

Return to bug 33260