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:
parent
c017a8f616
commit
acaf98ced0
1 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue