This commit is contained in:
2025-06-20 17:31:13 +02:00
parent 9158e33854
commit a38116cca4
65 changed files with 2298 additions and 2298 deletions

View File

@@ -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()];
}
}