futtern/tests/Entity/MenuItemTest.php
lubiana 34171d6c2b
All checks were successful
/ ls (pull_request) Successful in 37s
/ ls (push) Successful in 37s
/ ls (release) Successful in 24s
100% test coverage
2024-08-16 13:44:16 +02:00

27 lines
654 B
PHP

<?php declare(strict_types=1);
namespace App\Tests\Entity;
use App\Entity\FoodVendor;
use App\Entity\MenuItem;
use PHPUnit\Framework\TestCase;
final class MenuItemTest extends TestCase
{
public function testMenuItem(): void
{
$item = new MenuItem;
$item->setName('Test');
$this->assertEquals('Test', $item->getName());
$vendor = new FoodVendor;
$vendor->setName('Test');
$item->setFoodVendor($vendor);
$this->assertEquals($vendor, $item->getFoodVendor());
$this->assertFalse($item->isDeleted());
$item->delete();
$this->assertTrue($item->isDeleted());
}
}