Lines 5404-5410
subtest "updateWrongTransfer tests" => sub {
Link Here
|
5404 |
}; |
5404 |
}; |
5405 |
|
5405 |
|
5406 |
subtest "SendCirculationAlert" => sub { |
5406 |
subtest "SendCirculationAlert" => sub { |
5407 |
plan tests => 2; |
5407 |
plan tests => 3; |
5408 |
|
5408 |
|
5409 |
# When you would unsuspectingly call this unit test (with perl, not prove), you will be bitten by LOCK. |
5409 |
# When you would unsuspectingly call this unit test (with perl, not prove), you will be bitten by LOCK. |
5410 |
# LOCK will commit changes and ruin your data |
5410 |
# LOCK will commit changes and ruin your data |
Lines 5417-5423
subtest "SendCirculationAlert" => sub {
Link Here
|
5417 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
5417 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
5418 |
C4::Members::Messaging::SetMessagingPreference({ |
5418 |
C4::Members::Messaging::SetMessagingPreference({ |
5419 |
borrowernumber => $patron->id, |
5419 |
borrowernumber => $patron->id, |
5420 |
message_transport_types => ['email'], |
5420 |
message_transport_types => ['sms'], |
5421 |
message_attribute_id => 5 |
5421 |
message_attribute_id => 5 |
5422 |
}); |
5422 |
}); |
5423 |
my $item = $builder->build_sample_item(); |
5423 |
my $item = $builder->build_sample_item(); |
Lines 5430-5436
subtest "SendCirculationAlert" => sub {
Link Here
|
5430 |
name => 'Test Checkin', |
5430 |
name => 'Test Checkin', |
5431 |
is_html => 0, |
5431 |
is_html => 0, |
5432 |
content => "Checkins:\n----\n[% biblio.title %]-[% old_checkout.issue_id %]\n----Thank you.", |
5432 |
content => "Checkins:\n----\n[% biblio.title %]-[% old_checkout.issue_id %]\n----Thank you.", |
5433 |
message_transport_type => 'email', |
5433 |
message_transport_type => 'sms', |
5434 |
lang => 'default' |
5434 |
lang => 'default' |
5435 |
} |
5435 |
} |
5436 |
})->store; |
5436 |
})->store; |
Lines 5447-5452
subtest "SendCirculationAlert" => sub {
Link Here
|
5447 |
}); |
5447 |
}); |
5448 |
my $notice = Koha::Notice::Messages->find({ borrowernumber => $patron->id, letter_code => 'CHECKIN' }); |
5448 |
my $notice = Koha::Notice::Messages->find({ borrowernumber => $patron->id, letter_code => 'CHECKIN' }); |
5449 |
is($notice->content,"Checkins:\n".$item->biblio->title."-".$issue_1->id."\nThank you.", 'Letter generated with expected output on first checkin' ); |
5449 |
is($notice->content,"Checkins:\n".$item->biblio->title."-".$issue_1->id."\nThank you.", 'Letter generated with expected output on first checkin' ); |
|
|
5450 |
is($notice->to_address, $patron->smsalertnumber, "Letter has the correct to_address set to smsalertnumber for SMS type notices"); |
5450 |
|
5451 |
|
5451 |
# Checkout an item, mark it returned, generate a notice |
5452 |
# Checkout an item, mark it returned, generate a notice |
5452 |
my $issue_2 = AddIssue( $patron->unblessed, $item->barcode); |
5453 |
my $issue_2 = AddIssue( $patron->unblessed, $item->barcode); |