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

(-)a/t/db_dependent/Letters.t (-7 / +2 lines)
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);
(-)a/t/db_dependent/Members.t (-4 / +3 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 79;
20
use Test::More tests => 81;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Data::Dumper;
22
use Data::Dumper;
23
use C4::Context;
23
use C4::Context;
Lines 184-190 C4::Context->set_preference( 'EnableRedirectGuaranteeEmail', 1 ); Link Here
184
C4::Context->clear_syspref_cache();
184
C4::Context->clear_syspref_cache();
185
185
186
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
186
$notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'});
187
is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is activated");
187
is ($notice_email, "$GUARANTEE_EMAIL,$EMAILPRO", "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is activated");
188
188
189
189
190
ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired");
190
ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired");
Lines 328-334 my $borrower2 = $builder->build({ Link Here
328
        },
328
        },
329
});
329
});
330
330
331
my $guarantee = $builder->build({
331
$guarantee = $builder->build({
332
        source => 'Borrower',
332
        source => 'Borrower',
333
        value  => {
333
        value  => {
334
            categorycode=>'KIDclamp',
334
            categorycode=>'KIDclamp',
335
- 

Return to bug 12532