Bugzilla – Attachment 83545 Details for
Bug 22052
DeleteExpiredOpacRegistrations should skip bad borrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22052: Unit tests
Bug-22052-Unit-tests.patch (text/plain), 2.58 KB, created by
Nick Clemens
on 2018-12-28 19:19:10 UTC
(
hide
)
Description:
Bug 22052: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-12-28 19:19:10 UTC
Size:
2.58 KB
patch
obsolete
>From 7b11739d0255d120aa710e1160882ec37b2a6208 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 28 Dec 2018 18:48:15 +0000 >Subject: [PATCH] Bug 22052: Unit tests > >--- > t/db_dependent/Members.t | 35 ++++++++++++++++++++++++++++++++--- > 1 file changed, 32 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index b878afbfed..640f385da8 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -354,7 +354,7 @@ $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; > ok( $borrower->{userid}, 'A userid should have been generated correctly' ); > > subtest 'purgeSelfRegistration' => sub { >- plan tests => 2; >+ plan tests => 5; > > #purge unverified > my $d=360; >@@ -370,8 +370,37 @@ subtest 'purgeSelfRegistration' => sub { > t::lib::Mocks::mock_preference('PatronSelfRegistrationDefaultCategory', $c ); > t::lib::Mocks::mock_preference('PatronSelfRegistrationExpireTemporaryAccountsDelay', 360); > C4::Members::DeleteExpiredOpacRegistrations(); >- $dbh->do("INSERT INTO borrowers (surname, address, city, branchcode, categorycode, dateenrolled) VALUES ('Testaabbcc', 'Street 1', 'CITY', ?, '$c', '2014-01-01 01:02:03')", undef, $library1->{branchcode}); >- is( C4::Members::DeleteExpiredOpacRegistrations(), 1, 'Test for DeleteExpiredOpacRegistrations'); >+ my $self_reg = $builder->build_object({ >+ class => 'Koha::Patrons', >+ value => { >+ dateenrolled => '2014-01-01 01:02:03', >+ categorycode => $c >+ } >+ }); >+ >+ my $checkout = $builder->build_object({ >+ class=>'Koha::Checkouts', >+ value=>{ >+ borrowernumber=>$self_reg->borrowernumber >+ } >+ }); >+ is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations doesn't delete borrower with checkout"); >+ >+ my $account_line = $builder->build_object({ >+ class=>'Koha::Account::Lines', >+ value=>{ >+ borrowernumber=>$self_reg->borrowernumber, >+ amountoutstanding=>5 >+ } >+ }); >+ is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations doesn't delete borrower with checkout and fine"); >+ >+ $checkout->delete; >+ is( C4::Members::DeleteExpiredOpacRegistrations(), 0, "DeleteExpiredOpacRegistrations doesn't delete borrower with fine and no checkout"); >+ >+ $account_line->delete; >+ is( C4::Members::DeleteExpiredOpacRegistrations(), 1, "DeleteExpiredOpacRegistrations does delete borrower with no fines and no checkouts"); >+ > }; > > sub _find_member { >-- >2.11.0
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 22052
:
83545
|
83546
|
83660
|
83661
|
83662
|
83678
|
83679