From 207e109d1e1b8b4075d7f898ef1a81f813612ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 7 Sep 2023 11:12:44 +0200 Subject: [PATCH] Improve NotificationMailerTest by adding an assertion This assertion is performed by Prophecy's shouldBeCalled* method. --- .../Tests/Notification/Email/NotificationMailerTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php index 19da87b79..c00804e0b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php @@ -37,7 +37,6 @@ class NotificationMailerTest extends TestCase */ public function testPostPersistComment(): void { - $this->expectNotToPerformAssertions(); $user1 = (new User())->setEmail('user1@foo.com'); $user2 = (new User())->setEmail('user2@foo.com'); $user3 = (new User())->setEmail('user3@foo.com'); @@ -67,7 +66,7 @@ class NotificationMailerTest extends TestCase } return false; - })); + }))->shouldBeCalledTimes(2); $objectManager = $this->prophesize(EntityManagerInterface::class); @@ -77,7 +76,6 @@ class NotificationMailerTest extends TestCase public function testPostPersistCommentDestWithNullEmail(): void { - $this->expectNotToPerformAssertions(); $user1 = (new User())->setEmail('user1@foo.com'); $user2 = (new User())->setEmail('user2@foo.com'); $user3 = (new User())->setEmail(null); @@ -107,7 +105,7 @@ class NotificationMailerTest extends TestCase } return false; - })); + }))->shouldBeCalledTimes(1); $objectManager = $this->prophesize(EntityManagerInterface::class);