From 788bf6e86c0a7cdecda4a6e011bffa6013abf6ac Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 28 May 2014 17:45:11 +0000 Subject: [PATCH] Bug 11169: (follow-up) add more unit tests This patch adds direct unit tests of the new biblionumber filter for SearchOrders. It also moves the ordernumber filter test to the rest of the SearchOrders tests. To test: [1] Verify that prove -v t/db_dependent/Acquisition.t passes. Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Acquisition.t | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index 8936ec4de0..837024a297 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -8,7 +8,7 @@ use POSIX qw(strftime); use C4::Bookseller qw( GetBookSellerFromId ); -use Test::More tests => 77; +use Test::More tests => 79; BEGIN { use_ok('C4::Acquisition'); @@ -727,6 +727,21 @@ $search_orders = SearchOrders({ }); is( scalar (@$search_orders), 0, "SearchOrders with pending and ordered params gets only pending ordered orders (bug 11170)" ); +$search_orders = SearchOrders({ + ordernumber => $ordernumbers[4] +}); +is( scalar (@$search_orders), 1, "SearchOrders takes into account the ordernumber filter" ); + +$search_orders = SearchOrders({ + biblionumber => $biblionumber4 +}); +is( scalar (@$search_orders), 1, "SearchOrders takes into account the biblionumber filter" ); + +$search_orders = SearchOrders({ + biblionumber => $biblionumber4, + pending => 1 +}); +is( scalar (@$search_orders), 0, "SearchOrders takes into account the biblionumber and pending filters" ); # # Test GetBudgetByOrderNumber @@ -798,11 +813,6 @@ $search_orders = SearchOrders({ }); is( scalar (@$search_orders), 3, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" ); -$search_orders = SearchOrders({ - ordernumber => $ordernumbers[4] -}); -is( scalar (@$search_orders), 1, "SearchOrders takes into account the ordernumber filter" ); - # # Test AddClaim # -- 2.39.2