From c6c77d73745df51e37435aa6daf2b89dfe2bc3d4 Mon Sep 17 00:00:00 2001 From: mehdi Date: Mon, 25 Jul 2016 10:56:36 -0400 Subject: [PATCH] Bug 12532 - QA Follow-up Fixed tests, they now work without any fails https://bugs.koha-community.org/show_bug.cgi?id=12532 Signed-off-by: Marc --- t/db_dependent/Letters.t | 9 ++------- t/db_dependent/Members.t | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index bec56ef..bf773f0 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Test::More tests => 74; +use Test::More tests => 79; use Test::MockModule; use Test::Warn; @@ -165,7 +165,7 @@ my $guarantee = { }; $guarantee->{'borrowernumber'} = AddMember(%$guarantee); -my $GUARANTEE_TO_ADDRESS = 'toto@exemple.com'; +my $GUARANTEE_TO_ADDRESS = 'guarantor@example.com'; my $guarantee_message = { borrowernumber => $guarantee->{'borrowernumber'}, message_transport_type => 'email', @@ -192,11 +192,6 @@ $result = SendToGuarantor(1,$guarantee_message); is($result->{'status'}, "sent", "With EnableRedirectGuaranteeEmail on, message is sent."); is($result->{'to_address'}, $GUARANTOR_EMAIL, "With EnableRedirectGuaranteeEmail on, Message is sent to the guarantor's email address."); -$guarantor->{'email'} = undef; -ModMember(%$guarantor); -$result = SendToGuarantor(1,$guarantee_message); -is($result->{'status'}, "failed", "With EnableRedirectGuaranteeEmail on, message fails if guarantor has no address."); - $guarantee->{'guarantorid'} = undef; ModMember(%$guarantee); $result = SendToGuarantor(1,$guarantee_message); diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 6009d10..f60bba2 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 79; +use Test::More tests => 81; use Test::MockModule; use Data::Dumper; use C4::Context; @@ -184,7 +184,7 @@ C4::Context->set_preference( 'EnableRedirectGuaranteeEmail', 1 ); C4::Context->clear_syspref_cache(); $notice_email = GetNoticeEmailAddress($guarantee->{'borrowernumber'}); -is ($notice_email, $EMAILPRO, "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is activated"); +is ($notice_email, "$GUARANTEE_EMAIL,$EMAILPRO", "GetNoticeEmailAddress returns correct value when EnableRedirectGuaranteeEmail is activated"); ok(!$member->{is_expired}, "GetMemberDetails() indicates that patron is not expired"); @@ -328,7 +328,7 @@ my $borrower2 = $builder->build({ }, }); -my $guarantee = $builder->build({ +$guarantee = $builder->build({ source => 'Borrower', value => { categorycode=>'KIDclamp', -- 2.1.4