Release 2.36.0 (#5514)

This commit is contained in:
Kevin Papst
2025-06-02 16:07:48 +02:00
committed by GitHub
parent 594385f741
commit 2f2ebd6293
27 changed files with 466 additions and 257 deletions

View File

@@ -65,6 +65,9 @@ class TimesheetServiceTest extends TestCase
return $service;
}
/**
* @group legacy
*/
public function testCannotSavePersistedTimesheetAsNew(): void
{
$timesheet = $this->createMock(Timesheet::class);
@@ -75,7 +78,7 @@ class TimesheetServiceTest extends TestCase
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot create timesheet, already persisted');
$sut->saveNewTimesheet($timesheet);
$sut->saveNewTimesheet($timesheet); // @phpstan-ignore method.deprecated
}
public function testCannotStartTimesheet(): void
@@ -88,7 +91,7 @@ class TimesheetServiceTest extends TestCase
$this->expectException(AccessDeniedHttpException::class);
$this->expectExceptionMessage('You are not allowed to start this timesheet record');
$sut->saveNewTimesheet(new Timesheet());
$sut->saveTimesheet(new Timesheet());
}
public function testSaveNewTimesheetHasValidationError(): void
@@ -107,7 +110,7 @@ class TimesheetServiceTest extends TestCase
$this->expectException(ValidationFailedException::class);
$this->expectExceptionMessage('Validation Failed');
$sut->saveNewTimesheet(new Timesheet());
$sut->saveTimesheet(new Timesheet());
}
public function testSaveNewTimesheetStopsActiveRecords(): void
@@ -134,7 +137,7 @@ class TimesheetServiceTest extends TestCase
$sut = $this->getSut($authorizationChecker, null, null, $repository);
$sut->saveNewTimesheet($newTimesheet);
$sut->saveTimesheet($newTimesheet);
}
public function testSaveNewTimesheetFixesTimezone(): void
@@ -155,11 +158,14 @@ class TimesheetServiceTest extends TestCase
$authorizationChecker->expects($this->once())->method('isGranted')->willReturn(true);
$sut = $this->getSut($authorizationChecker);
$sut->saveNewTimesheet($timesheet);
$sut->saveTimesheet($timesheet);
self::assertEquals('Europe/Paris', $timesheet->getTimezone());
}
/**
* @group legacy
*/
public function testUpdateTimesheetFixesTimezone(): void
{
$user = new User();
@@ -176,7 +182,7 @@ class TimesheetServiceTest extends TestCase
$sut = $this->getSut();
$sut->updateTimesheet($timesheet);
$sut->updateTimesheet($timesheet); // @phpstan-ignore method.deprecated
self::assertEquals('Europe/Paris', $timesheet->getTimezone());
}