added setting to limit the maximum length of a timesheet record (#2612)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user