improve test coverage
All checks were successful
/ ls (pull_request) Successful in 39s

This commit is contained in:
lubiana 2024-08-16 11:14:41 +02:00
parent a4f62868fd
commit 6f23c3c1b7
No known key found for this signature in database
3 changed files with 132 additions and 2 deletions

View file

@ -58,7 +58,7 @@ class FoodOrder
return $this->closedAt;
}
public function setClosedAt(DateTimeImmutable|null $closedAt): static
public function setClosedAt(DateTimeImmutable|null $closedAt = null): static
{
$this->closedAt = $closedAt;
@ -67,7 +67,15 @@ class FoodOrder
public function isClosed(): bool
{
return $this->closedAt instanceof DateTimeImmutable && $this->closedAt->getTimestamp() <= (new DateTimeImmutable)->getTimestamp();
if ($this->closedAt === null) {
return false;
}
if ($this->closedAt < new DateTimeImmutable) {
return true;
}
return false;
}
public function close(): static