Bugzilla – Attachment 34314 Details for
Bug 12868
GetMemberDetails calls GetMemberAccountRecords incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12868: Improving t/db_dependent/Member.t
Bug-12868-Improving-tdbdependentMembert.patch (text/plain), 2.71 KB, created by
Marcel de Rooy
on 2014-12-11 12:49:14 UTC
(
hide
)
Description:
Bug 12868: Improving t/db_dependent/Member.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-12-11 12:49:14 UTC
Size:
2.71 KB
patch
obsolete
>From 6b4dbf788684d00b803b5fbc70689c40595af431 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 3 Sep 2014 19:09:46 -0400 >Subject: [PATCH] Bug 12868: Improving t/db_dependent/Member.t >Content-Type: text/plain; charset=utf-8 > >The mock function of GetMemberAccountRecord did not properly >account for the undef case. This was corrected. > >Then all 4 combinations of borrower number and card number being >defined or not were called to GetMemberDetail. > >The problematic test case is where the borrower number is >undefined and the cardnumber is defined. > >TEST PLAN >--------- >1) Apply just this first patch. >2) prove -v t/db_dependent/Member.t > -- This should fail! >3) Run koha QA test tools. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Members.t | 26 +++++++++++++++++++++++--- > 1 files changed, 23 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 0161c7b..4e4fff5 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -305,17 +305,37 @@ is( Check_Userid( C4::Context->config('user'), '' ), 0, > > subtest 'GetMemberAccountBalance' => sub { > >- plan tests => 6; >+ plan tests => 10; > > my $members_mock = new Test::MockModule('C4::Members'); > $members_mock->mock( 'GetMemberAccountRecords', sub { >- my @accountlines = ( >+ my ($borrowernumber) = @_; >+ if ($borrowernumber) { >+ my @accountlines = ( > { amountoutstanding => '7', accounttype => 'Rent' }, > { amountoutstanding => '5', accounttype => 'Res' }, > { amountoutstanding => '3', accounttype => 'Pay' } ); >- return ( 15, \@accountlines ); >+ return ( 15, \@accountlines ); >+ } >+ else { >+ my @accountlines; >+ return ( 0, \@accountlines ); >+ } > }); > >+ my $person = GetMemberDetails(undef,undef); >+ ok( !$person , 'Expected no member details from undef,undef' ); >+ $person = GetMemberDetails(undef,'987654321'); >+ is( $person->{amountoutstanding}, 15, >+ 'Expected 15 outstanding for cardnumber.'); >+ $borrowernumber = $person->{borrowernumber}; >+ $person = GetMemberDetails($borrowernumber,undef); >+ is( $person->{amountoutstanding}, 15, >+ 'Expected 15 outstanding for borrowernumber.'); >+ $person = GetMemberDetails($borrowernumber,'987654321'); >+ is( $person->{amountoutstanding}, 15, >+ 'Expected 15 outstanding for both borrowernumber and cardnumber.'); >+ > # do not count holds charges > C4::Context->set_preference( 'HoldsInNoissuesCharge', '1' ); > C4::Context->set_preference( 'ManInvInNoissuesCharge', '0' ); >-- >1.7.7.6
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 12868
:
31354
|
31355
|
33942
|
33943
| 34314 |
34315