added setting to limit the maximum length of a timesheet record (#2612)

This commit is contained in:
Kevin Papst
2021-06-12 01:05:33 +02:00
committed by GitHub
parent 53e01177d9
commit 7460647d58
19 changed files with 366 additions and 28 deletions

View File

@@ -48,6 +48,10 @@ final class TimesheetFixtures implements TestFixture
* @var \DateTime
*/
private $startDate;
/**
* @var \DateTime
*/
private $fixedStartDate;
/**
* @var bool
*/
@@ -129,6 +133,13 @@ final class TimesheetFixtures implements TestFixture
return $this;
}
public function setFixedStartDate(\DateTime $date): TimesheetFixtures
{
$this->fixedStartDate = $date;
return $this;
}
public function setAmountRunning(int $amount): TimesheetFixtures
{
$this->running = $amount;
@@ -312,6 +323,10 @@ final class TimesheetFixtures implements TestFixture
private function getDateTime(int $i): \DateTime
{
if ($this->fixedStartDate !== null) {
return $this->fixedStartDate;
}
if ($this->startDate === null) {
$this->startDate = new \DateTime('2018-04-01');
}