Bugzilla – Attachment 82788 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.17 KB, created by
Martin Renvoize (ashimema)
on 2018-11-30 13:36:15 UTC
(
hide
)
Description:
Bug 21720: Update Tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-11-30 13:36:15 UTC
Size:
2.17 KB
patch
obsolete
>From 638ed255243e49197ae976a0535e0ea907935b2c 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. >--- > 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 f613f081f1..e2eea78dcb 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; >@@ -204,16 +204,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.19.2
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