mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-20 20:22:49 +00:00
fix cs
This commit is contained in:
@@ -44,33 +44,6 @@ final class NotificationApiControllerTest extends WebTestCase
|
||||
self::$toDelete = [];
|
||||
}
|
||||
|
||||
public static function generateDataMarkAsRead()
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$userRepository = self::getContainer()->get(UserRepository::class);
|
||||
$userA = $userRepository->findOneBy(['username' => 'center a_social']);
|
||||
$userB = $userRepository->findOneBy(['username' => 'center b_social']);
|
||||
|
||||
$notification = new Notification();
|
||||
$notification
|
||||
->setMessage('Test generated')
|
||||
->setRelatedEntityClass(AccompanyingPeriod::class)
|
||||
->setRelatedEntityId(0)
|
||||
->setSender($userB)
|
||||
->addAddressee($userA)
|
||||
->setUpdatedAt(new \DateTimeImmutable());
|
||||
$em->persist($notification);
|
||||
$em->refresh($notification);
|
||||
$em->flush();
|
||||
|
||||
self::$toDelete[] = [Notification::class, $notification->getId()];
|
||||
|
||||
self::ensureKernelShutdown();
|
||||
|
||||
yield [$notification->getId()];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider generateDataMarkAsRead
|
||||
*/
|
||||
@@ -99,4 +72,31 @@ final class NotificationApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertFalse($notification->isReadBy($user));
|
||||
}
|
||||
|
||||
public static function generateDataMarkAsRead()
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$userRepository = self::getContainer()->get(UserRepository::class);
|
||||
$userA = $userRepository->findOneBy(['username' => 'center a_social']);
|
||||
$userB = $userRepository->findOneBy(['username' => 'center b_social']);
|
||||
|
||||
$notification = new Notification();
|
||||
$notification
|
||||
->setMessage('Test generated')
|
||||
->setRelatedEntityClass(AccompanyingPeriod::class)
|
||||
->setRelatedEntityId(0)
|
||||
->setSender($userB)
|
||||
->addAddressee($userA)
|
||||
->setUpdatedAt(new \DateTimeImmutable());
|
||||
$em->persist($notification);
|
||||
$em->refresh($notification);
|
||||
$em->flush();
|
||||
|
||||
self::$toDelete[] = [Notification::class, $notification->getId()];
|
||||
|
||||
self::ensureKernelShutdown();
|
||||
|
||||
yield [$notification->getId()];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user