Bugzilla – Attachment 55195 Details for
Bug 16911
Koha::Patrons - Move ExtendMemberSubscriptionTo to ->renew_account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16911: Rename extend_subscription with renew_account
Bug-16911-Rename-extendsubscription-with-renewacco.patch (text/plain), 4.00 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-09-05 18:24:47 UTC
(
hide
)
Description:
Bug 16911: Rename extend_subscription with renew_account
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-09-05 18:24:47 UTC
Size:
4.00 KB
patch
obsolete
>From 26873ddaf5e53fce68d04e2475d99bfd55751697 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Jul 2016 20:29:15 +0100 >Subject: [PATCH] Bug 16911: Rename extend_subscription with renew_account > >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Patron.pm | 6 +++--- > members/setstatus.pl | 2 +- > t/db_dependent/Koha/Patrons.t | 10 +++++----- > 3 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index ff508a3..fc5496f 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -209,15 +209,15 @@ sub update_password { > return 1; > } > >-=head3 extend_subscription >+=head3 renew_account > >-my $new_expiry_date = $patron->extend_subscription >+my $new_expiry_date = $patron->renew_account > > Extending the subscription to the expiry date. > > =cut > >-sub extend_subscription { >+sub renew_account { > my ($self) = @_; > > my $date = >diff --git a/members/setstatus.pl b/members/setstatus.pl >index e607e50..f00bcba 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -47,7 +47,7 @@ my $dateexpiry; > > if ( $reregistration eq 'y' ) { > # re-reregistration function to automatic calcul of date expiry >- $dateexpiry = Koha::Patrons->find( $borrowernumber )->extend_subscription; >+ $dateexpiry = Koha::Patrons->find( $borrowernumber )->renew_account; > } else { > my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?"); > $sth->execute( $status, $borrowernumber ); >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 117ecb4..0f71655 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -129,7 +129,7 @@ subtest 'update_password' => sub { > is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->update_password should not have logged' ); > }; > >-subtest 'extend_subscription' => sub { >+subtest 'renew_account' => sub { > plan tests => 6; > my $a_month_ago = dt_from_string->add( months => -1 )->truncate( to => 'day' ); > my $a_year_later = dt_from_string->add( months => 12 )->truncate( to => 'day' ); >@@ -154,21 +154,21 @@ subtest 'extend_subscription' => sub { > > t::lib::Mocks::mock_preference( 'BorrowerRenewalPeriodBase', 'dateexpiry' ); > t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); >- my $expiry_date = $retrieved_patron->extend_subscription; >+ my $expiry_date = $retrieved_patron->renew_account; > is( $expiry_date, $a_year_later_minus_a_month, ); > my $retrieved_expiry_date = Koha::Patrons->find( $patron->{borrowernumber} )->dateexpiry; > is( dt_from_string($retrieved_expiry_date), $a_year_later_minus_a_month ); > my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'RENEW', object => $retrieved_patron->borrowernumber } )->count; >- is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->extend_subscription should have logged' ); >+ is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->renew_account should have logged' ); > > t::lib::Mocks::mock_preference( 'BorrowerRenewalPeriodBase', 'now' ); > t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); >- $expiry_date = $retrieved_patron->extend_subscription; >+ $expiry_date = $retrieved_patron->renew_account; > is( $expiry_date, $a_year_later, ); > $retrieved_expiry_date = Koha::Patrons->find( $patron->{borrowernumber} )->dateexpiry; > is( dt_from_string($retrieved_expiry_date), $a_year_later ); > $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'RENEW', object => $retrieved_patron->borrowernumber } )->count; >- is( $number_of_logs, 1, 'Without BorrowerLogs, Koha::Patron->extend_subscription should not have logged' ); >+ is( $number_of_logs, 1, 'Without BorrowerLogs, Koha::Patron->renew_account should not have logged' ); > > $retrieved_patron->delete; > }; >-- >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 16911
:
53338
|
53339
|
53340
|
53341
|
53346
|
53514
|
53515
|
53516
|
53517
|
53518
|
53533
|
54752
|
54753
|
54754
|
54755
|
54756
|
54757
|
54789
|
54790
|
54791
|
54792
|
54793
|
54794
|
55191
|
55192
|
55193
|
55194
| 55195 |
55196
|
55197
|
55424
|
55447