From f1b680dc5d3c889bceb2c39aaea09affc00b5d6d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 16 Aug 2019 14:43:42 -0300 Subject: [PATCH] Bug 14570: (QA follow-up) Fix tests Signed-off-by: Tomas Cohen Arazi Signed-off-by: Agustin Moyano Signed-off-by: Liz Rea Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Patrons.t | 3 +++ t/db_dependent/Members.t | 3 +++ 2 files changed, 6 insertions(+) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index e511e195f2..e528a59bbd 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -87,6 +87,9 @@ subtest 'library' => sub { subtest 'guarantees' => sub { plan tests => 13; + + t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test|test2' ); + my $guarantees = $new_patron_1->guarantee_relationships; is( ref($guarantees), 'Koha::Patron::Relationships', 'Koha::Patron->guarantees should return a Koha::Patrons result set in a scalar context' ); is( $guarantees->count, 0, 'new_patron_1 should have 0 guarantee relationships' ); diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t index 91f4b3d200..cdfa209c1f 100755 --- a/t/db_dependent/Members.t +++ b/t/db_dependent/Members.t @@ -265,6 +265,9 @@ $patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_ ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by last issue date'); Koha::Patrons->find($bor1inlist)->set({ categorycode => 'CIVILIAN' })->store; + +t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); + my $relationship = Koha::Patron::Relationship->new( { guarantor_id => $bor1inlist, guarantee_id => $guarantee->{borrowernumber}, relationship => 'test' } )->store(); $patstodel = GetBorrowersToExpunge( {patron_list_id => $list1->patron_list_id()} ); -- 2.22.1