Bugzilla – Attachment 119594 Details for
Bug 25183
cleanup-database.pl --del-exp-selfreg fully deletes borrowers - should go into deleted-borrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25183: Add unit tests
Bug-25183-Add-unit-tests.patch (text/plain), 2.10 KB, created by
Kyle M Hall (khall)
on 2021-04-14 16:05:21 UTC
(
hide
)
Description:
Bug 25183: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-04-14 16:05:21 UTC
Size:
2.10 KB
patch
obsolete
>From c6594e233b93f710c90189b07bda1c54856959b2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 14 Apr 2021 12:04:19 -0400 >Subject: [PATCH] Bug 25183: Add unit tests > >--- > t/db_dependent/Members.t | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index b7a1ceea15..0499606d2a 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -22,12 +22,14 @@ use Test::MockModule; > use Test::Exception; > > use Data::Dumper qw/Dumper/; >+ > use C4::Context; > use Koha::Database; > use Koha::Holds; > use Koha::List::Patron; >-use Koha::Patrons; >+use Koha::Old::Patrons; > use Koha::Patron::Relationship; >+use Koha::Patrons; > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -401,7 +403,8 @@ $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; > ok( $borrower->{userid}, 'A userid should have been generated correctly' ); > > subtest 'purgeSelfRegistration' => sub { >- plan tests => 5; >+ plan tests => 8; >+ Koha::Old::Patrons->delete; > > #purge unverified > my $d=360; >@@ -449,8 +452,23 @@ subtest 'purgeSelfRegistration' => sub { > is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations doesn't delete borrower with fine and no checkout"); > > $account_line->delete; >+ is( C4::Members::DeleteExpiredOpacRegistrations('soft'), 1, "DeleteExpiredOpacRegistrations does delete borrower with no fines and no checkouts"); >+ >+ is( Koha::Old::Patrons->count, 1, "Patron soft deleted, moved to delete patrons table" ); >+ Koha::Old::Patrons->delete; >+ >+ my $self_reg_2 = $builder->build_object({ >+ class => 'Koha::Patrons', >+ value => { >+ dateenrolled => '2014-01-01 01:02:03', >+ categorycode => $c >+ } >+ }); >+ > is( C4::Members::DeleteExpiredOpacRegistrations(), 1, "DeleteExpiredOpacRegistrations does delete borrower with no fines and no checkouts"); > >+ is( Koha::Old::Patrons->count, 0, "Patron hard deleted, not moved to delete patrons table" ); >+ > }; > > sub _find_member { >-- >2.24.3 (Apple Git-128)
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 25183
:
103603
|
103784
|
119019
|
119593
| 119594