From 25549d8401ccf358a9e9bda8f37d05a6d653d409 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 16 Oct 2020 16:30:49 -0300 Subject: [PATCH] Bug 23091: Add tests for \->credits and \->debits Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Account/Line.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t index 183134613f6..5a43abe3ece 100755 --- a/t/db_dependent/Koha/Account/Line.t +++ b/t/db_dependent/Koha/Account/Line.t @@ -615,7 +615,7 @@ subtest 'checkout() tests' => sub { }; subtest 'credits() and debits() tests' => sub { - plan tests => 10; + plan tests => 12; $schema->storage->txn_begin; @@ -670,6 +670,17 @@ subtest 'credits() and debits() tests' => sub { $debit = $debits->next; is($debit->amount + 0, 12, 'Correct second debit'); + throws_ok + { $debit1->debits; } + 'Koha::Exceptions::Account::IsNotCredit', + 'Exception is thrown when requesting debits linked to debit'; + + throws_ok + { $credit1->credits; } + 'Koha::Exceptions::Account::IsNotDebit', + 'Exception is thrown when requesting credits linked to credit'; + + $schema->storage->txn_rollback; }; -- 2.28.0