From c1d0d3df82a9ce6ae10c9564a883f1b7803a702e 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 --- t/Acquisition/CanUserManageBasket.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/Acquisition/CanUserManageBasket.t b/t/Acquisition/CanUserManageBasket.t index 0733474..5dc540f 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,9 @@ ok( CanUserManageBasket($borrower2, $basket2, $flags) ); ok( not CanUserManageBasket($borrower2, $basket3, $flags) ); ok( CanUserManageBasket($borrower2, $basket4, $flags) ); +# Test for Bug +# basket 4 is not managed by borrower3 but by other borrowers +ok( not CanUserManageBasket($borrower3, $basket4, $flags) ); # Mocked subs -- 2.1.4