From 794061a947f3275ac82e6fc0a168ae44a0af6b28 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 14 Jun 2017 12:33:25 +0200 Subject: [PATCH] Bug 18756 - add Unit Test Signed-off-by: Lee Jamison Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 8b15c064405ff4a48cb3f5803dd6bd16d49d5b9b) Signed-off-by: Fridolin Somers (cherry picked from commit 40db2dcc388706b54f13db9c312ee7f181f6bd9b) Signed-off-by: Katrin Fischer --- t/Acquisition/CanUserManageBasket.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/Acquisition/CanUserManageBasket.t b/t/Acquisition/CanUserManageBasket.t index 0733474f97..a862983f70 100644 --- a/t/Acquisition/CanUserManageBasket.t +++ b/t/Acquisition/CanUserManageBasket.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 42; +use Test::More tests => 43; use C4::Acquisition; @@ -30,6 +30,11 @@ my $borrower2 = { branchcode => 'B2', }; +my $borrower3 = { + borrowernumber => 3, + branchcode => 'B3', +}; + # Baskets my $basket1 = { basketno => 1, @@ -185,6 +190,8 @@ ok( CanUserManageBasket($borrower2, $basket2, $flags) ); ok( not CanUserManageBasket($borrower2, $basket3, $flags) ); ok( CanUserManageBasket($borrower2, $basket4, $flags) ); +# basket 4 is not managed by borrower3 but by other borrowers +ok( not CanUserManageBasket($borrower3, $basket4, $flags) ); # Mocked subs -- 2.39.5