Bugzilla – Attachment 52929 Details for
Bug 16819
C4::Members::DelMember should use Koha::Holds to delete holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16819: Unit tests for C4::Members::DelMember
Bug-16819-Unit-tests-for-C4MembersDelMember.patch (text/plain), 1.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-06-28 14:08:39 UTC
(
hide
)
Description:
Bug 16819: Unit tests for C4::Members::DelMember
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-06-28 14:08:39 UTC
Size:
1.75 KB
patch
obsolete
>From 142bd75010d70a0e992ef88be2eeead0fdd2905b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 28 Jun 2016 10:57:38 -0300 >Subject: [PATCH] Bug 16819: Unit tests for C4::Members::DelMember > >The C4::Members::DelMember function actually deletes reserves, and it is >not properly tested. > >To test: >- Apply the patch >- Run: > $ prove t/db_dependent/Members.t >=> SUCCESS: Tests pass >- Sign off > >Sponsored-by: NEKLS >--- > t/db_dependent/Members.t | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 797e9bc..006207b 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,11 +17,12 @@ > > use Modern::Perl; > >-use Test::More tests => 77; >+use Test::More tests => 79; > use Test::MockModule; > use Data::Dumper; > use C4::Context; > use Koha::Database; >+use Koha::Holds; > use Koha::List::Patron; > > >@@ -167,10 +168,20 @@ ModMember(borrowernumber => $member->{'borrowernumber'}, dateexpiry => '2001-01- > $member = GetMemberDetails($member->{'borrowernumber'}); > ok($member->{is_expired}, "GetMemberDetails() indicates that patron is expired"); > >-# clean up >+# Create a reserve for the patron >+$builder->build({ >+ source => 'Reserve', >+ value => { >+ borrowernumber => $member->{ borrowernumber } >+ } >+}); >+is( Koha::Holds->search({ borrowernumber => $member->{borrowernumber} })->count, >+ 1, 'Hold created correctly' ); > DelMember($member->{borrowernumber}); > my $borrower = GetMember( cardnumber => $CARDNUMBER ); > is( $borrower, undef, 'DelMember should remove the patron' ); >+is( Koha::Holds->search({ borrowernumber => $member->{borrowernumber} })->count, >+ 0, 'Hold deleted correctly' ); > > # Check_Userid tests > %data = ( >-- >2.7.4
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 16819
:
52929
|
52930
|
53030
|
53031
|
53054
|
53055
|
53056