mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
notification: more check in test
This commit is contained in:
parent
b323ddae05
commit
f453dbb543
@ -27,7 +27,7 @@ final class NotificationTest extends KernelTestCase
|
||||
{
|
||||
private array $toDelete = [];
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
}
|
||||
@ -70,15 +70,21 @@ final class NotificationTest extends KernelTestCase
|
||||
$notification->addAddressee($user1 = new User());
|
||||
$notification->addAddressee($user2 = new User());
|
||||
$notification->getAddressees()->add($user3 = new User());
|
||||
$notification->getAddressees()->add($user4 = new User());
|
||||
|
||||
$this->assertCount(3, $notification->getAddressees());
|
||||
$this->assertCount(4, $notification->getAddressees());
|
||||
|
||||
// launch listener
|
||||
$notification->registerUnread();
|
||||
$this->assertCount(3, $notification->getUnreadBy());
|
||||
$this->assertCount(4, $notification->getUnreadBy());
|
||||
$this->assertContains($user1, $notification->getUnreadBy()->toArray());
|
||||
$this->assertContains($user2, $notification->getUnreadBy()->toArray());
|
||||
$this->assertContains($user3, $notification->getUnreadBy()->toArray());
|
||||
|
||||
$notification->markAsReadBy($user1);
|
||||
|
||||
$this->assertCount(3, $notification->getUnreadBy());
|
||||
$this->assertNotContains($user1, $notification->getUnreadBy()->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user