27 lines
654 B
PHP
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());
|
|
}
|
|
}
|