Bug 20946: Additional unit tests for 0 lines edge case
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 26 Jun 2018 13:20:26 +0000 (13:20 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 6 Jul 2018 10:33:13 +0000 (10:33 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

t/db_dependent/Koha/Account.t

index bf0e0b6..5d15f4a 100755 (executable)
@@ -31,7 +31,7 @@ my $builder = t::lib::TestBuilder->new;
 
 subtest 'outstanding_debits() tests' => sub {
 
-    plan tests => 5;
+    plan tests => 7;
 
     $schema->storage->txn_begin;
 
@@ -55,5 +55,10 @@ subtest 'outstanding_debits() tests' => sub {
         $i++;
     }
 
+    ( $total, $lines ) =  Koha::Account->new({ patron_id => 'InvalidBorrowernumber' })->outstanding_debits();
+    is( $total, 0, "Total if no outstanding debits is 0" );
+    is( $lines->count, 0, "With no outstanding debits, we get back a Lines object with 0 lines" );
+
+
     $schema->storage->txn_rollback;
 };