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 => 74; |
21 |
use Test::More tests => 79; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
Lines 165-171
my $guarantee = {
Link Here
|
165 |
}; |
165 |
}; |
166 |
$guarantee->{'borrowernumber'} = AddMember(%$guarantee); |
166 |
$guarantee->{'borrowernumber'} = AddMember(%$guarantee); |
167 |
|
167 |
|
168 |
my $GUARANTEE_TO_ADDRESS = 'toto@exemple.com'; |
168 |
my $GUARANTEE_TO_ADDRESS = 'guarantor@example.com'; |
169 |
my $guarantee_message = { |
169 |
my $guarantee_message = { |
170 |
borrowernumber => $guarantee->{'borrowernumber'}, |
170 |
borrowernumber => $guarantee->{'borrowernumber'}, |
171 |
message_transport_type => 'email', |
171 |
message_transport_type => 'email', |
Lines 192-202
$result = SendToGuarantor(1,$guarantee_message);
Link Here
|
192 |
is($result->{'status'}, "sent", "With EnableRedirectGuaranteeEmail on, message is sent."); |
192 |
is($result->{'status'}, "sent", "With EnableRedirectGuaranteeEmail on, message is sent."); |
193 |
is($result->{'to_address'}, $GUARANTOR_EMAIL, "With EnableRedirectGuaranteeEmail on, Message is sent to the guarantor's email address."); |
193 |
is($result->{'to_address'}, $GUARANTOR_EMAIL, "With EnableRedirectGuaranteeEmail on, Message is sent to the guarantor's email address."); |
194 |
|
194 |
|
195 |
$guarantor->{'email'} = undef; |
|
|
196 |
ModMember(%$guarantor); |
197 |
$result = SendToGuarantor(1,$guarantee_message); |
198 |
is($result->{'status'}, "failed", "With EnableRedirectGuaranteeEmail on, message fails if guarantor has no address."); |
199 |
|
200 |
$guarantee->{'guarantorid'} = undef; |
195 |
$guarantee->{'guarantorid'} = undef; |
201 |
ModMember(%$guarantee); |
196 |
ModMember(%$guarantee); |
202 |
$result = SendToGuarantor(1,$guarantee_message); |
197 |
$result = SendToGuarantor(1,$guarantee_message); |