From 271442a93cc0f4631247f90645e60ced2fc3effa Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 31 Jul 2017 11:30:00 -0300 Subject: [PATCH] Bug 17699: Add test descriptions Test plan: prove -v t/db_dependent/Koha/Patrons.t Subtest: renew_account 1..30 ok 1 - 2016-02-29T00:00:00 + 12 months must be 2017-02-28T00:00:00 ok 2 - 2016-02-29T00:00:00 + 12 months must be 2017-02-28T00:00:00 ok 3 - With BorrowerLogs, Koha::Patron->renew_account should have logged ok 4 - today + 12 months must be 2017-03-31T00:00:00 ok 5 - today + 12 months must be 2017-03-31T00:00:00 ok 6 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged ok 7 - today + 12 months must be 2017-03-31T00:00:00 ok 8 - today + 12 months must be 2017-03-31T00:00:00 ok 9 - 2016-04-30T00:00:00 + 12 months must be 2017-04-30T00:00:00 ok 10 - 2016-04-30T00:00:00 + 12 months must be 2017-04-30T00:00:00 ok 11 - 2016-10-30T00:00:00 + 12 months must be 2017-10-30T00:00:00 ok 12 - 2016-10-30T00:00:00 + 12 months must be 2017-10-30T00:00:00 ok 13 - With BorrowerLogs, Koha::Patron->renew_account should have logged ok 14 - today + 12 months must be 2017-11-30T00:00:00 ok 15 - today + 12 months must be 2017-11-30T00:00:00 ok 16 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged ok 17 - today + 12 months must be 2017-11-30T00:00:00 ok 18 - today + 12 months must be 2017-11-30T00:00:00 ok 19 - 2016-12-30T00:00:00 + 12 months must be 2017-12-30T00:00:00 ok 20 - 2016-12-30T00:00:00 + 12 months must be 2017-12-30T00:00:00 ok 21 - 2017-06-30T00:00:00 + 12 months must be 2018-06-30T00:00:00 ok 22 - 2017-06-30T00:00:00 + 12 months must be 2018-06-30T00:00:00 ok 23 - With BorrowerLogs, Koha::Patron->renew_account should have logged ok 24 - today + 12 months must be 2018-07-31T00:00:00 ok 25 - today + 12 months must be 2018-07-31T00:00:00 ok 26 - Without BorrowerLogs, Koha::Patron->renew_account should not have logged ok 27 - today + 12 months must be 2018-07-31T00:00:00 ok 28 - today + 12 months must be 2018-07-31T00:00:00 ok 29 - 2017-08-31T00:00:00 + 12 months must be 2018-08-31T00:00:00 ok 30 - 2017-08-31T00:00:00 + 12 months must be 2018-08-31T00:00:00 --- t/db_dependent/Koha/Patrons.t | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 19aca2b2a7..cf06c4e8f7 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -292,31 +292,31 @@ subtest 'renew_account' => sub { t::lib::Mocks::mock_preference( 'BorrowerRenewalPeriodBase', 'dateexpiry' ); t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); my $expiry_date = $retrieved_patron->renew_account; - is( $expiry_date, $a_year_later_minus_a_month, ); + is( $expiry_date, $a_year_later_minus_a_month, "$a_month_ago + 12 months must be $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 ); + is( dt_from_string($retrieved_expiry_date), $a_year_later_minus_a_month, "$a_month_ago + 12 months must be $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->renew_account should have logged' ); t::lib::Mocks::mock_preference( 'BorrowerRenewalPeriodBase', 'now' ); t::lib::Mocks::mock_preference( 'BorrowersLog', 0 ); $expiry_date = $retrieved_patron->renew_account; - is( $expiry_date, $a_year_later, ); + is( $expiry_date, $a_year_later, "today + 12 months must be $a_year_later" ); $retrieved_expiry_date = Koha::Patrons->find( $patron->{borrowernumber} )->dateexpiry; - is( dt_from_string($retrieved_expiry_date), $a_year_later ); + is( dt_from_string($retrieved_expiry_date), $a_year_later, "today + 12 months must be $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->renew_account should not have logged' ); t::lib::Mocks::mock_preference( 'BorrowerRenewalPeriodBase', 'combination' ); $expiry_date = $retrieved_patron_2->renew_account; - is( $expiry_date, $a_year_later ); + is( $expiry_date, $a_year_later, "today + 12 months must be $a_year_later" ); $retrieved_expiry_date = Koha::Patrons->find( $patron_2->{borrowernumber} )->dateexpiry; - is( dt_from_string($retrieved_expiry_date), $a_year_later ); + is( dt_from_string($retrieved_expiry_date), $a_year_later, "today + 12 months must be $a_year_later" ); $expiry_date = $retrieved_patron_3->renew_account; - is( $expiry_date, $a_year_later_plus_a_month ); + is( $expiry_date, $a_year_later_plus_a_month, "$a_month_later + 12 months must be $a_year_later_plus_a_month" ); $retrieved_expiry_date = Koha::Patrons->find( $patron_3->{borrowernumber} )->dateexpiry; - is( dt_from_string($retrieved_expiry_date), $a_year_later_plus_a_month ); + is( dt_from_string($retrieved_expiry_date), $a_year_later_plus_a_month, "$a_month_later + 12 months must be $a_year_later_plus_a_month" ); $retrieved_patron->delete; $retrieved_patron_2->delete; -- 2.11.0