From 00bd47147626ad259b1ff924537e4f2123a09ad0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 27 Sep 2023 13:57:49 +0200 Subject: [PATCH] Bug 34930: Change timezone in Koha/Object.t where tests assume it This is the case for subtest: attributes_from_api() tests. Test plan: export TZ='Europe/Amsterdam' prove t/db_dependent/Koha/Object.t Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer --- t/db_dependent/Koha/Object.t | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index c1b0b379d3..056dbbdfbc 100755 --- a/t/db_dependent/Koha/Object.t +++ b/t/db_dependent/Koha/Object.t @@ -690,6 +690,10 @@ subtest 'attributes_from_api() tests' => sub { my $patron = Koha::Patron->new(); + delete $C4::Context::context->{tz}; + local %ENV; + $ENV{TZ} = 'Etc/UTC'; # following tests implicitly assume it + my $attrs = $patron->attributes_from_api( { updated_on => '2019-12-27T14:53:00Z', @@ -761,6 +765,9 @@ subtest 'attributes_from_api() tests' => sub { 'date_of_birth', 'Exception parameter is the API field name, not the DB one' ); + + # Remove timezone change + delete $C4::Context::context->{tz}; }; subtest 'booleans handling tests' => sub { -- 2.30.2