From 01f0173193e0d7ded2d727be4660de14d8dbacb2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 20 Aug 2020 12:52:09 +0100 Subject: [PATCH] Bug 19036: (follow-up) Test credits should be credits A series of accountlines added to mock credits were being added with a debit_type_code instead of a valid credit_type_code and so were being mis-identified by the new credit numbering code trigger in the store routine. This patch updates the test to correctly identify the credits as credits Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/Account/Lines.t | 36 ++++++++++------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t index c9151f41cb..039fb809f0 100755 --- a/t/db_dependent/Koha/Account/Lines.t +++ b/t/db_dependent/Koha/Account/Lines.t @@ -71,8 +71,7 @@ subtest 'total_outstanding() tests' => sub { my $credit_1 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -84,8 +83,7 @@ subtest 'total_outstanding() tests' => sub { my $credit_2 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -97,8 +95,7 @@ subtest 'total_outstanding() tests' => sub { my $credit_3 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -100, amountoutstanding => -100, interface => 'commandline', @@ -147,8 +144,7 @@ subtest 'total() tests' => sub { my $credit_1 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -160,8 +156,7 @@ subtest 'total() tests' => sub { my $credit_2 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -173,8 +168,7 @@ subtest 'total() tests' => sub { my $credit_3 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -100, amountoutstanding => -100, interface => 'commandline', @@ -223,8 +217,7 @@ subtest 'credits_total() tests' => sub { my $credit_1 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -236,8 +229,7 @@ subtest 'credits_total() tests' => sub { my $credit_2 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => -10, interface => 'commandline', @@ -249,8 +241,7 @@ subtest 'credits_total() tests' => sub { my $credit_3 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -100, amountoutstanding => -100, interface => 'commandline', @@ -299,8 +290,7 @@ subtest 'debits_total() tests' => sub { my $credit_1 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => 0, interface => 'commandline', @@ -312,8 +302,7 @@ subtest 'debits_total() tests' => sub { my $credit_2 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -10, amountoutstanding => 0, interface => 'commandline', @@ -325,8 +314,7 @@ subtest 'debits_total() tests' => sub { my $credit_3 = Koha::Account::Line->new( { borrowernumber => $patron->id, - debit_type_code => "OVERDUE", - status => "RETURNED", + credit_type_code => "PAYMENT", amount => -100, amountoutstanding => 0, interface => 'commandline', -- 2.20.1