futtern/tests/Entity/FoodOrderTest.php
lubiana 7674b6a6bd
All checks were successful
/ ls (pull_request) Successful in 2m13s
/ ls (push) Successful in 2m11s
add mutation testing
2024-09-17 17:55:33 +02:00

24 lines
730 B
PHP

<?php declare(strict_types=1);
namespace App\Tests\Entity;
use App\Entity\FoodOrder;
use App\Entity\OrderItem;
use PHPUnit\Framework\TestCase;
final class FoodOrderTest extends TestCase
{
public function testFoodOrder(): void
{
$order = new FoodOrder;
$orderItem = new OrderItem;
$this->assertCount(0, $order->getOrderItems());
$order->addOrderItem($orderItem);
$order->addOrderItem($orderItem);
$this->assertCount(1, $order->getOrderItems());
$this->assertSame($order, $orderItem->getFoodOrder());
$order->removeOrderItem($orderItem);
$this->assertCount(0, $order->getOrderItems());
$this->assertNull($orderItem->getFoodOrder());
}
}