Bug 16934: Add test for ModOrder
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Jul 2016 17:23:00 +0000 (18:23 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 22 Jul 2016 17:13:17 +0000 (17:13 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Acquisition.t

index 7c80387..6f1a0d2 100755 (executable)
@@ -19,7 +19,7 @@ use Modern::Perl;
 
 use POSIX qw(strftime);
 
-use Test::More tests => 91;
+use Test::More tests => 92;
 use Koha::Database;
 
 BEGIN {
@@ -938,6 +938,13 @@ 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
 
+subtest 'ModOrder' => sub {
+    plan tests => 1;
+    ModOrder( { ordernumber => $order1->{ordernumber}, unitprice => 42 } );
+    my $order = GetOrder( $order1->{ordernumber} );
+    is( int($order->{unitprice}), 42, 'ModOrder should work even if biblionumber if not passed');
+};
+
 # Budget reports
 my $all_count = scalar GetBudgetsReport();
 ok($all_count >= 1, "GetBudgetReport OK");