migrate test cases to use pestphp syntax
All checks were successful
/ ls (pull_request) Successful in 1m27s
/ ls (push) Successful in 1m24s
/ ls (release) Successful in 49s

This commit is contained in:
lubiana 2025-02-01 22:37:07 +01:00
parent af9354ff22
commit 9c98735db7
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
14 changed files with 365 additions and 415 deletions

View file

@ -0,0 +1,32 @@
<?php declare(strict_types=1);
namespace App\Tests\Unit\Entity;
use App\Entity\FoodOrder;
use App\Entity\OrderItem;
use function expect;
use function test;
test('FoodOrder Entity', function (): void {
$order = new FoodOrder;
$orderItem = new OrderItem;
expect($order->getOrderItems())
->toBeEmpty();
$order->addOrderItem($orderItem);
$order->addOrderItem($orderItem);
expect($order->getOrderItems())
->toHaveCount(1)
->and($orderItem->getFoodOrder())
->toBe($order);
$order->removeOrderItem($orderItem);
expect($order->getOrderItems())
->toBeEmpty()
->and($orderItem->getFoodOrder())
->toBeNull();
})
->covers(FoodOrder::class, OrderItem::class);