#29: add more tests
All checks were successful
/ ls (pull_request) Successful in 37s
/ ls (push) Successful in 32s

This commit is contained in:
lubiana 2024-07-10 22:18:56 +02:00
parent c4cd275c83
commit 9afa7fe431
No known key found for this signature in database
8 changed files with 331 additions and 184 deletions

View file

@ -8,19 +8,12 @@ use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Component\Uid\Ulid;
#[ORM\Entity(repositoryClass: FoodOrderRepository::class)]
class FoodOrder
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\Column(type: UlidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private Ulid|null $id = null;
#[ORM\Column(nullable: true)]
private DateTimeImmutable|null $closedAt = null;
@ -39,8 +32,11 @@ class FoodOrder
])]
private string|null $createdBy = 'nobody';
public function __construct()
{
public function __construct(
#[ORM\Id]
#[ORM\Column(type: UlidType::NAME, unique: true)]
private Ulid|null $id = new Ulid
) {
$this->orderItems = new ArrayCollection;
$this->open();
}