Bug 16419: follow-up of bug 11371 - Fix t/db_dependent/Acquisition.t
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 May 2016 14:41:42 +0000 (15:41 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 3 May 2016 15:30:42 +0000 (15:30 +0000)
The tests added by bug 11371 have been put after the rollback statement.

Test plan:
  prove t/db_dependent/Acquisition.t
should return green

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tests fail before the patch, and pass with it. QA scripts like the patch too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Acquisition.t

index 6063f09..16e0c86 100755 (executable)
@@ -941,16 +941,14 @@ ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \
 ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
 # End of tests for DelOrder
 
-$schema->storage->txn_rollback();
 # Budget reports
-#my @report = GetBudgetReport(1);
-#ok(@report >= 1, "GetBudgetReport OK");
-
 my $all_count = scalar GetBudgetsReport();
 ok($all_count >= 1, "GetBudgetReport OK");
 
 my $active_count = scalar GetBudgetsReport(1);
 ok($active_count >= 1 , "GetBudgetsReport(1) OK");
 
-ok($all_count == scalar GetBudgetsReport(), "GetBudgetReport returns inactive budget period acquisitions.");
+is($all_count, scalar GetBudgetsReport(), "GetBudgetReport returns inactive budget period acquisitions.");
 ok($active_count >= scalar GetBudgetsReport(1), "GetBudgetReport doesn't return inactive budget period acquisitions.");
+
+$schema->storage->txn_rollback();