0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-27 02:08:43 +00:00

fix flaky test

This commit is contained in:
Kevin Papst 2021-07-27 19:19:55 +02:00
parent c017a8f616
commit acaf98ced0

View file

@ -203,8 +203,16 @@ class DateTimeFactoryTest extends TestCase
{
$sut = $this->createDateTimeFactory(self::TEST_TIMEZONE);
$expected = $sut->createDateTime('2021-07-22 23:59:59 ');
$financial = $sut->createStartOfFinancialYear('2020-07-23 15:30:00');
$now = $sut->createDateTime();
$expected = $sut->createDateTime();
$expected->setDate($expected->format('Y'), 7, 22);
$expected->setTime(23, 59, 59);
if ($now > $expected) {
$expected->modify('+1 year');
}
$financial = $sut->createStartOfFinancialYear('2018-07-23 15:30:00');
$end = $sut->createEndOfFinancialYear($financial);
self::assertEquals($expected, $end);