|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 4; |
22 |
use Test::More tests => 5; |
| 23 |
|
23 |
|
| 24 |
use C4::Letters qw( GetPreparedLetter EnqueueLetter ); |
24 |
use C4::Letters qw( GetPreparedLetter EnqueueLetter ); |
| 25 |
|
25 |
|
|
Lines 207-213
WRAPPED
Link Here
|
| 207 |
} |
207 |
} |
| 208 |
); |
208 |
); |
| 209 |
|
209 |
|
| 210 |
$wrapped_compare = "<div style=\"white-space: pre-wrap;\">This is a test template using borrower $borrowernumber</div>"; |
210 |
$wrapped_compare = |
|
|
211 |
"<div style=\"white-space: pre-wrap;\">This is a test template using borrower $borrowernumber</div>"; |
| 211 |
|
212 |
|
| 212 |
$message = Koha::Notice::Messages->find($message_id); |
213 |
$message = Koha::Notice::Messages->find($message_id); |
| 213 |
is( |
214 |
is( |
|
Lines 238-243
subtest 'patron() tests' => sub {
Link Here
|
| 238 |
$schema->storage->txn_rollback; |
239 |
$schema->storage->txn_rollback; |
| 239 |
}; |
240 |
}; |
| 240 |
|
241 |
|
|
|
242 |
subtest 'template() tests' => sub { |
| 243 |
plan tests => 2; |
| 244 |
|
| 245 |
$schema->storage->txn_begin; |
| 246 |
|
| 247 |
my $template = $builder->build_object( { class => 'Koha::Notice::Templates' } ); |
| 248 |
my $message = $builder->build_object( |
| 249 |
{ |
| 250 |
class => 'Koha::Notice::Messages', |
| 251 |
value => { letter_id => $template->id } |
| 252 |
} |
| 253 |
); |
| 254 |
|
| 255 |
is( ref( $message->template ), 'Koha::Notice::Template', 'Object type is correct' ); |
| 256 |
is( $message->template->id, $template->id, 'Right template linked' ); |
| 257 |
|
| 258 |
$schema->storage->txn_rollback; |
| 259 |
}; |
| 260 |
|
| 241 |
subtest 'search_limited' => sub { |
261 |
subtest 'search_limited' => sub { |
| 242 |
plan tests => 2; |
262 |
plan tests => 2; |
| 243 |
|
263 |
|
| 244 |
- |
|
|