From ff29f978af3950d39a2b10d440aac67b418bff26 Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Mon, 19 Mar 2012 19:16:48 -0400 Subject: [PATCH] Bug 5374 [SIGNED-OFF] Followup: adds conditional check to unit test for late orders If there are no late orders in the database, the 5th unit test for C4/Acquisition.pm fails, since no date is returned (and today's date is expected) This patch adds a conditional check around whether any late orders are actually returned by GetLateOrders. If so, tests proceed, if not, they're skipped. This seems to quiet the failures in the automated test suite. http://bugs.koha-community.org/show_bug.cgi?id=5347 signed-off-by: Jonathan Druart --- t/db_dependent/Acquisition.t | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t index ab0b6d0294..6e845f856a 100755 --- a/t/db_dependent/Acquisition.t +++ b/t/db_dependent/Acquisition.t @@ -33,10 +33,13 @@ my $orders = GetPendingOrders( $supplierid, $grouped ); isa_ok( $orders, 'ARRAY' ); my @lateorders = GetLateOrders(0); -my $order = $lateorders[0]; -AddClaim( $order->{ordernumber} ); -my $neworder = GetOrder( $order->{ordernumber} ); -is( $neworder->{claimed_date}, strftime( "%Y-%m-%d", localtime(time) ), "AddClaim : Check claimed_date" ); +SKIP: { + skip 'No Late Orders, cannot test AddClaim', 1 unless @lateorders; + my $order = $lateorders[0]; + AddClaim( $order->{ordernumber} ); + my $neworder = GetOrder( $order->{ordernumber} ); + is( $neworder->{claimed_date}, strftime( "%Y-%m-%d", localtime(time) ), "AddClaim : Check claimed_date" ); +} SKIP: { skip 'No relevant orders in database, cannot test baskets', 33 unless( scalar @$orders ); @@ -56,7 +59,7 @@ SKIP: { entrydate firstname freight - gst + gstrate listprice notes ordernumber -- 2.39.2