From 2346ba293e1fcd67451e779696e6a9121630ee67 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Tue, 26 Jun 2018 13:20:26 +0000
Subject: [PATCH] Bug 20946: Additional unit tests for 0 lines edge case

---
 t/db_dependent/Koha/Account.t | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t
index bf0e0b677d..5d15f4aa61 100755
--- a/t/db_dependent/Koha/Account.t
+++ b/t/db_dependent/Koha/Account.t
@@ -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;
 };
-- 
2.15.2 (Apple Git-101.1)