Bugzilla – Attachment 53030 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]
[SIGNED-OFF]Bug 16819: Unit tests for C4::Members::DelMember
SIGNED-OFFBug-16819-Unit-tests-for-C4MembersDelMem.patch (text/plain), 1.82 KB, created by
Héctor Eduardo Castro Avalos
on 2016-07-01 15:17:32 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 16819: Unit tests for C4::Members::DelMember
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-07-01 15:17:32 UTC
Size:
1.82 KB
patch
obsolete
>From 5b23873ead2b5345802276959619fe2a67dfe46c 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] [SIGNED-OFF]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 >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >--- > 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 = ( >-- >1.7.10.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