#97: add emojis to foodvendor

This commit is contained in:
lubiana 2025-06-21 15:15:47 +02:00
parent e2167fa19f
commit c8e6af6896
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
7 changed files with 176 additions and 4 deletions

View file

@ -5,6 +5,7 @@ namespace App\Tests\Unit\Entity;
use App\Entity\FoodOrder;
use App\Entity\FoodVendor;
use App\Entity\MenuItem;
use InvalidArgumentException;
use Symfony\Component\Uid\Ulid;
use function describe;
@ -20,6 +21,17 @@ describe(FoodVendor::class, function (): void {
$vendor->setPhone('1234567890');
$this->assertEquals('1234567890', $vendor->getPhone());
// Test emojis field
$this->assertNull($vendor->getEmojis());
$emojis = '😀😂🎉👍❤️';
$vendor->setEmojis($emojis);
$this->assertEquals($emojis, $vendor->getEmojis());
// Test emojis validation
$tooManyEmojis = '😀😂🎉👍❤️🚀🎈🎁🎊🎋🎍🎎🎏🎐🎑🎒🎓🎔🎕🎖🎗🎘🎙🎚🎛🎜🎝🎞🎟🎠🎡🎢';
$this->expectException(InvalidArgumentException::class);
$vendor->setEmojis($tooManyEmojis);
$this->assertCount(0, $vendor->getFoodOrders());
$order1 = new FoodOrder;
$vendor->addFoodOrder($order1);