Bugzilla – Attachment 86011 Details for
Bug 22446
Koha/Patron/Categories.t is failing on March 1st (2019 only?) and Feb 29th 2024
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22446: Explicitely list what we expect to avoid ambiguity
Bug-22446-Explicitely-list-what-we-expect-to-avoid.patch (text/plain), 3.05 KB, created by
Jonathan Druart
on 2019-03-04 16:19:20 UTC
(
hide
)
Description:
Bug 22446: Explicitely list what we expect to avoid ambiguity
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-04 16:19:20 UTC
Size:
3.05 KB
patch
obsolete
>From 9d8754b480cb18e20b2ee00dfddc668479cec89e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Mar 2019 13:18:51 -0300 >Subject: [PATCH] Bug 22446: Explicitely list what we expect to avoid ambiguity > >--- > t/db_dependent/Koha/Patron/Categories.t | 54 ++++++++++++++++++++++++++++----- > 1 file changed, 47 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron/Categories.t b/t/db_dependent/Koha/Patron/Categories.t >index 1e2ddb7d6d..3153c8aa17 100644 >--- a/t/db_dependent/Koha/Patron/Categories.t >+++ b/t/db_dependent/Koha/Patron/Categories.t >@@ -62,16 +62,56 @@ is( $retrieved_category_1->checkprevcheckout, 'inherit', 'Koha::Patron::Category > is( $retrieved_category_2->checkprevcheckout, 'inherit', 'Koha::Patron::Category->store should default checkprevcheckout to inherit' ); > > subtest 'get_expiry_date' => sub { >- plan tests => 5; >- for my $date ( '2016-03-31', '2016-11-30', '2019-01-31', '2019-03-01', dt_from_string() ) { >- subtest "get_expiry_date with today=$date" => sub { >+ plan tests => 3; >+ my $cases = [ >+ { >+ today => '2016-03-31', >+ next_month => '2016-04-30', >+ next_year => '2017-03-31', >+ yesterday => '2016-03-30', >+ }, >+ { >+ today => '2016-11-30', >+ next_month => '2016-12-31', >+ next_year => '2017-11-30', >+ yesterday => '2016-11-29', >+ }, >+ { >+ today => '2019-01-31', >+ next_month => '2019-02-28', >+ next_year => '2020-01-31', >+ yesterday => '2019-01-30', >+ }, >+ { >+ today => '2019-02-28', >+ next_month => '2019-03-31', >+ next_year => '2020-02-29', >+ yesterday => '2019-02-27', >+ }, >+ { >+ today => '2019-03-01', >+ next_month => '2019-02-28', >+ next_year => '2020-03-01', >+ yesterday => '2019-02-28', >+ }, >+ { >+ today => '2020-02-29', >+ next_month => '2021-03-31', >+ next_year => '2021-02-28', >+ yesterday => '2020-02-28', >+ }, >+ # TODO re-add today, dt_from_string >+ ]; >+ for my $date ( @$cases ) { >+ my $today = $date->{today}; >+ subtest "get_expiry_date with today=$today" => sub { > plan tests => 5; >- my $dt = dt_from_string( $date, 'iso' ); >+ my $dt = dt_from_string( $today, 'iso' ); > Time::Fake->offset( $dt->epoch ); > >- my $next_month = dt_from_string->add( months => 1 ); >- my $next_year = dt_from_string->add( months => 12 ); >- my $yesterday = dt_from_string->add( days => -1 ); >+ my $next_month = dt_from_string($date->{next_month}, 'iso'); >+ my $next_year = dt_from_string($date->{next_year}, 'iso'); >+ my $yesterday = dt_from_string($date->{yesterday}, 'iso'); > my $category = Koha::Patron::Category->new({ > categorycode => 'mycat', > category_type => 'A', >-- >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 22446
:
85952
| 86011