|
Lines 5385-5391
subtest "updateWrongTransfer tests" => sub {
Link Here
|
| 5385 |
}; |
5385 |
}; |
| 5386 |
|
5386 |
|
| 5387 |
subtest "SendCirculationAlert" => sub { |
5387 |
subtest "SendCirculationAlert" => sub { |
| 5388 |
plan tests => 2; |
5388 |
plan tests => 3; |
| 5389 |
|
5389 |
|
| 5390 |
# When you would unsuspectingly call this unit test (with perl, not prove), you will be bitten by LOCK. |
5390 |
# When you would unsuspectingly call this unit test (with perl, not prove), you will be bitten by LOCK. |
| 5391 |
# LOCK will commit changes and ruin your data |
5391 |
# LOCK will commit changes and ruin your data |
|
Lines 5398-5404
subtest "SendCirculationAlert" => sub {
Link Here
|
| 5398 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
5398 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 5399 |
C4::Members::Messaging::SetMessagingPreference({ |
5399 |
C4::Members::Messaging::SetMessagingPreference({ |
| 5400 |
borrowernumber => $patron->id, |
5400 |
borrowernumber => $patron->id, |
| 5401 |
message_transport_types => ['email'], |
5401 |
message_transport_types => ['sms'], |
| 5402 |
message_attribute_id => 5 |
5402 |
message_attribute_id => 5 |
| 5403 |
}); |
5403 |
}); |
| 5404 |
my $item = $builder->build_sample_item(); |
5404 |
my $item = $builder->build_sample_item(); |
|
Lines 5411-5417
subtest "SendCirculationAlert" => sub {
Link Here
|
| 5411 |
name => 'Test Checkin', |
5411 |
name => 'Test Checkin', |
| 5412 |
is_html => 0, |
5412 |
is_html => 0, |
| 5413 |
content => "Checkins:\n----\n[% biblio.title %]-[% old_checkout.issue_id %]\n----Thank you.", |
5413 |
content => "Checkins:\n----\n[% biblio.title %]-[% old_checkout.issue_id %]\n----Thank you.", |
| 5414 |
message_transport_type => 'email', |
5414 |
message_transport_type => 'sms', |
| 5415 |
lang => 'default' |
5415 |
lang => 'default' |
| 5416 |
} |
5416 |
} |
| 5417 |
})->store; |
5417 |
})->store; |
|
Lines 5428-5433
subtest "SendCirculationAlert" => sub {
Link Here
|
| 5428 |
}); |
5428 |
}); |
| 5429 |
my $notice = Koha::Notice::Messages->find({ borrowernumber => $patron->id, letter_code => 'CHECKIN' }); |
5429 |
my $notice = Koha::Notice::Messages->find({ borrowernumber => $patron->id, letter_code => 'CHECKIN' }); |
| 5430 |
is($notice->content,"Checkins:\n".$item->biblio->title."-".$issue_1->id."\nThank you.", 'Letter generated with expected output on first checkin' ); |
5430 |
is($notice->content,"Checkins:\n".$item->biblio->title."-".$issue_1->id."\nThank you.", 'Letter generated with expected output on first checkin' ); |
|
|
5431 |
is($notice->to_address, $patron->smsalertnumber, "Letter has the correct to_address set to smsalertnumber for SMS type notices"); |
| 5431 |
|
5432 |
|
| 5432 |
# Checkout an item, mark it returned, generate a notice |
5433 |
# Checkout an item, mark it returned, generate a notice |
| 5433 |
my $issue_2 = AddIssue( $patron->unblessed, $item->barcode); |
5434 |
my $issue_2 = AddIssue( $patron->unblessed, $item->barcode); |