Bugzilla – Attachment 65421 Details for
Bug 17699
DateTime durations are not correctly subtracted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17699: Add test descriptions
Bug-17699-Add-test-descriptions.patch (text/plain), 5.82 KB, created by
Marcel de Rooy
on 2017-08-02 12:04:54 UTC
(
hide
)
Description:
Bug 17699: Add test descriptions
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-08-02 12:04:54 UTC
Size:
5.82 KB
patch
obsolete
>From 270f5cbd8d32b7b0521645aa1f5e2f63e29ad550 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 31 Jul 2017 11:30:00 -0300 >Subject: [PATCH] Bug 17699: Add test descriptions >Content-Type: text/plain; charset=utf-8 > >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 > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 19aca2b..cf06c4e 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.1.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 17699
:
57827
|
65358
|
65359
|
65360
|
65365
|
65366
|
65367
|
65369
|
65370
|
65371
|
65372
|
65400
|
65419
|
65420
| 65421 |
65422