mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
notification: add test for unread consistency
This commit is contained in:
23
src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php
Normal file
23
src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class NotificationTest extends TestCase
|
||||
{
|
||||
public function testAddAddresseeStoreAnUread()
|
||||
{
|
||||
$notification = new Notification();
|
||||
$notification->addAddressee($user1 = new User());
|
||||
$notification->addAddressee($user2 = new User());
|
||||
|
||||
$this->assertCount(2, $notification->getAddressees());
|
||||
$this->assertCount(2, $notification->getUnreadBy());
|
||||
$this->assertContains($user1, $notification->getUnreadBy()->toArray());
|
||||
$this->assertContains($user2, $notification->getUnreadBy()->toArray());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user