Browse Source

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 <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
MM-OPAC/theme_dep
Galen Charlton 10 years ago
committed by Tomas Cohen Arazi
parent
commit
788bf6e86c
  1. 22
      t/db_dependent/Acquisition.t

22
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
#

Loading…
Cancel
Save