forked from lubiana/futtern
#97: add emojis to foodvendor
This commit is contained in:
parent
e2167fa19f
commit
c8e6af6896
7 changed files with 176 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue