Bugzilla – Attachment 85176 Details for
Bug 21720
Update C4::Circulation::AddIssuingCharge to use Koha::Account->add_debit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21720: Update Tests
Bug-21720-Update-Tests.patch (text/plain), 2.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-02-15 14:26:50 UTC
(
hide
)
Description:
Bug 21720: Update Tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-02-15 14:26:50 UTC
Size:
2.28 KB
patch
obsolete
>From 8774087f6f83364b0bf539be09af018612e51099 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 30 Nov 2018 13:30:24 +0000 >Subject: [PATCH] Bug 21720: Update Tests > >AddIssuing charge is always called in void context, but the tests >checked that the return value was a Koha::Account::Offset and we now >return a Koha::Account::Line. > >This patch changes the test to accept a Koha::Account::Line as returned, >adds a test to ensure a Koha::Account::Offset is also created and >corrects the logic that tests that only one accountline is added. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Circulation/issue.t | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 9dff999749..336323977b 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 32; >+use Test::More tests => 33; > use DateTime::Duration; > > use t::lib::Mocks; >@@ -191,16 +191,16 @@ is ($countissue,1,"1 issues have been added"); > $query = " SELECT count(*) FROM accountlines"; > $sth = $dbh->prepare($query); > $sth->execute; >-my $countaccount = $sth -> fetchrow_array; >+my $countaccount = $sth->fetchrow_array; > is ($countaccount,0,"0 accountline exists"); > my $checkout = Koha::Checkouts->find( $issue_id1 ); >-my $offset = C4::Circulation::AddIssuingCharge( $checkout, 10 ); >-is( ref( $offset ), 'Koha::Account::Offset', "An issuing charge has been added" ); >-my $charge = Koha::Account::Lines->find( $offset->debit_id ); >+my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10 ); >+is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" ); > is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); >-my $account_id = $dbh->last_insert_id( undef, undef, 'accountlines', undef ); >+my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } ); >+is( $offset->credit_id, undef, 'Offset was created'); > $sth->execute; >-$countaccount = $sth -> fetchrow_array; >+$countaccount = $sth->fetchrow_array; > is ($countaccount,1,"1 accountline has been added"); > > # Test AddRenewal >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21720
:
81882
|
82787
|
82788
|
83199
|
83200
|
84271
|
84272
|
85175
| 85176