From 3b6d71030d75d22163a05cba5e2b757dcb891cfd Mon Sep 17 00:00:00 2001 From: Alexis Ripetti Date: Wed, 16 Dec 2020 12:09:14 -0500 Subject: [PATCH] Bug 12532 - Correction of tests involving guarantorid --- t/db_dependent/Members.t | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 7a1a4ef995..51f81c1eb2 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -134,8 +134,19 @@ my $GUARANTOR_EMAIL = "Robert\@email.com"; email => $GUARANTOR_EMAIL ); -$member->{guarantorid} = Koha::Patron->new(\%data)->store->borrowernumber; -$patron->set($member)->store; +$addmem=Koha::Patron->new(\%data)->store->borrowernumber; +ok($addmem, "Koha::Patron->store()"); + +my $patron_guarantor = Koha::Patrons->find( { cardnumber => (\%data)->{'cardnumber'} } ) + or BAIL_OUT("Cannot read member with card (\%data)->{'cardnumber'}"); +my $member_guarantor = $patron_guarantor->unblessed; + +my %data2 = ( + guarantor_id => $member_guarantor->{borrowernumber}, + guarantee_id => $member->{borrowernumber}, + relationship => "father" +); +Koha::Patron::Relationship->new(\%data2)->store; $member = Koha::Patrons->find( { cardnumber => $CARDNUMBER } ); t::lib::Mocks::mock_preference( 'RedirectGuaranteeEmail', '0' ); -- 2.25.1