Skip to content
Snippets Groups Projects
Commit 9ed4d370 authored by Andreas Kienast's avatar Andreas Kienast Committed by Nikita Hovratov
Browse files

[BUGFIX] Handle roll-over of dates in `RotatingFileWriterTest`

In the test class `RotatingFileWriterTest`, the `MONTHLY` and `YEARLY`
cases for `writingLogWithExpiredLatestRotationInTimeFrameRotates` may
fail as it tries to create a mock file that needs rotation with a
broken date.

It is expected to create a file with a date of the previous period
that's tested. However, at the end of uneven months or each Feb. 29th
this will heavily fail due to PHP's automatic roll-over to the next
valid date. We'd need a fallback to the latest valid date here.

The aforementioned test now has a special handling in place in case
either `MONTHLY` or `YEARLY` are tested – the date is modified to go
back to the first day of the respective period and then either set the
current day OR the latest days in that period, whatever fits.

Resolves: #103509
Releases: main
Change-Id: Ic60c3056ed31933ff7be3af196ba08ed92f04855
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83630


Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
parent d64c5fcd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment