@@ -, +, @@ renew_account --- Koha/Patron.pm | 6 +++--- members/setstatus.pl | 2 +- t/db_dependent/Koha/Patrons.t | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) --- a/Koha/Patron.pm +++ a/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 = --- a/members/setstatus.pl +++ a/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 ); --- a/t/db_dependent/Koha/Patrons.t +++ a/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; }; --