Bug 13993: (1) Add tests to confirm 'new' and 'cancelled'
authorMark Tompsett <mtompset@hotmail.com>
Thu, 16 Apr 2015 12:54:30 +0000 (08:54 -0400)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Fri, 19 Jun 2015 14:44:45 +0000 (11:44 -0300)
This adds 2 tests to t/db_dependent/Acquisition/TransferOrder.t
in order to confirm the order's status is properly marked.

TEST PLAN
---------
1) Log into staff client
2) Acquisitions
3) Create a basket for two differing vendors.
4) Place an order in one of the baskets.
5) Transfer the order from one vendor's basket to the others.
6) Apply this patch (1) only
7) prove -v t/db_dependent/Acquisition/TransferOrder.t
   -- should fail one test: not marked as 'cancelled'.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
t/db_dependent/Acquisition/TransferOrder.t

index 646e770..d2bfda2 100644 (file)
@@ -2,7 +2,7 @@
 
 use Modern::Perl;
 
-use Test::More tests => 11;
+use Test::More tests => 13;
 use C4::Context;
 use C4::Acquisition;
 use C4::Biblio;
@@ -79,6 +79,12 @@ is(scalar GetOrders($basketno2), 0, "0 order in basket2");
 my $newordernumber = TransferOrder($ordernumber, $basketno2);
 is(scalar GetOrders($basketno1), 0, "0 order in basket1");
 is(scalar GetOrders($basketno2), 1, "1 order in basket2");
+
+# Determine if the transfer marked things cancelled properly.
+is($order->{orderstatus},'new','Order marked as new as expected');
+($order) = GetOrders($basketno1, { 'cancelled' => 1 });
+is($order->{orderstatus},'cancelled','Order marked as cancelled as expected');
+
 ($order) = GetOrders($basketno2);
 is(scalar GetItemnumbersFromOrder($order->{ordernumber}), 1, "1 item in basket2's order");